李永亮
李永亮
  • 发布:2023-09-01 16:22
  • 更新:2023-09-01 16:22
  • 阅读:868

高德定位插件与内置地图组件冲突

分类:插件市场

定位插件Android原生代码使用了定位SDK,implementation('com.amap.api:location:6.4.0’。
HBuilderX打包时勾选HBuilderX manifest.json地图模块,打包失败,与HBuilderX内置的地图组件冲突。报错如下:

  • What went wrong:
    Execution failed for task ':app:checkReleaseDuplicateClasses'.

    A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
    Duplicate class com.amap.api.fence.DistrictItem found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.fence.DistrictItem$1 found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.fence.GeoFence found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.fence.GeoFence$1 found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.fence.GeoFenceClient found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.fence.GeoFenceListener found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.fence.PoiItem found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.fence.PoiItem$1 found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.AMapLocation found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.AMapLocation$1 found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.AMapLocationClient found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.AMapLocationClientOption found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.AMapLocationClientOption$1 found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.AMapLocationClientOption$2 found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.AMapLocationClientOption$AMapLocationMode found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.AMapLocationClientOption$AMapLocationProtocol found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.AMapLocationClientOption$AMapLocationPurpose found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.AMapLocationClientOption$GeoLanguage found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.AMapLocationListener found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.AMapLocationQualityReport found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.APSService found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.CoordUtil found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.CoordinateConverter found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.CoordinateConverter$1 found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.CoordinateConverter$CoordType found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.DPoint found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.DPoint$1 found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.UmidtokenInfo found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.UmidtokenInfo$1 found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)
    Duplicate class com.amap.api.location.UmidtokenInfo$a found in modules jetified-3dmap-9.5.0 (com.amap.api:3dmap:9.5.0) and jetified-location-6.4.0 (com.amap.api:location:6.4.0)

看到package.json说明中提到可以用excludeDependencies,“使用前请在官方QQ交流群“DCloud原生开发者群”中联系管理员确认”。(然而在QQ群等了几个小时,也没人回复,体验很差,只好来这问了)。
我试了配置一下excludeDependencies,
"excludeDependencies”: [
“com.amap.api:location:6.4.0”
]
这样能够解决问题,但有个疑问,这时插件使用的定位SDK就不是我自己的了吧,而是HBuilderX内置的?另外也不知道对地图组件的使用有没有影响。

官方人员看到的话能不能来 “DCloud原生开发者群4” 交流一下,或者QQ(192227519)交流一下。还有一些别的疑问,这种方式实在是不方便交流。

2023-09-01 16:22 负责人:无 分享
已邀请:

要回复问题请先登录注册