t***@163.com
t***@163.com
  • 发布:2024-11-23 14:31
  • 更新:2024-12-04 19:35
  • 阅读:270

原生插件制作,android端

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: Mac 13.6.1 (22G313)

HBuilderX类型: Alpha

HBuilderX版本号: 4.29

手机系统: Android

手机系统版本号: Android 14

手机厂商: 三星

手机机型: galaxy

页面类型: nvue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:

package.json 依赖库配置如下:
"dependencies": [
"com.google.android.material:material:1.8.0",
"androidx.constraintlayout:constraintlayout:2.1.4",
"androidx.recyclerview:recyclerview:1.2.1",
"androidx.legacy:legacy-support-v4:1.0.0",
"androidx.appcompat:appcompat:1.0.0",
"com.alibaba:fastjson:1.2.83",
"com.facebook.fresco:fresco:1.13.0",
"com.google.android.gms:play-services-location:18.0.0",

            {  
                "id": "com.google.android.libraries.navigation:navigation",  
                "source": "implementation ('com.google.android.libraries.navigation:navigation:6.0.0',{\r\nexclude group: 'com.google.android.gms'\r\n})"  
            },  
            {  
                "id":"com.google.android.libraries.places:places",  
                "source":"implementation ('com.google.android.libraries.places:places:3.3.0',{\r\nexclude group: 'com.google.android.gms'\r\n})"  
            }  

]

android studio gradle 第三发配置如下:
dependencies {
implementation project(path: ':uniplugin_component')
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
//uniapp配置
compileOnly fileTree(dir: '../app/libs', include: ['uniapp-v8-release.aar'])
compileOnly 'androidx.recyclerview:recyclerview:1.2.1'
compileOnly 'androidx.legacy:legacy-support-v4:1.0.0'
compileOnly 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.alibaba:fastjson:1.2.83'
implementation 'com.facebook.fresco:fresco:1.13.0'

///ditu  
implementation ('com.google.android.libraries.navigation:navigation:6.0.0',{  
    exclude group: 'com.google.android.gms', module: 'play-services-maps'  
})  
implementation ('com.google.android.libraries.places:places:3.3.0',{  
    exclude group: 'com.google.android.gms'  
})  
implementation 'com.google.android.gms:play-services-location:18.0.0'  

}

操作步骤:

制作自定义基座

预期结果:

打包成功

实际结果:

打包失败

bug描述:

制作自定义基座,报打包失败

2024-11-23 14:31 负责人:DCloud_App_Array 分享
已邀请:
DCloud_App_Array

DCloud_App_Array

插件依赖的库com.google.android.libraries.navigation:navigation:6.0.0和com.google.android.gms:play-services-maps:18.0.2冲突导致,关键错误信息如下:

Duplicate class com.google.android.gms.maps.CameraUpdate found in modules jetified-navigation-6.0.0-runtime (com.google.android.libraries.navigation:navigation:6.0.0) and jetified-play-services-maps-18.0.2-runtime (com.google.android.gms:play-services-maps:18.0.2)  
Duplicate class com.google.android.gms.maps.CameraUpdateFactory found in modules jetified-navigation-6.0.0-runtime (com.google.android.libraries.navigation:navigation:6.0.0) and jetified-play-services-maps-18.0.2-runtime (com.google.android.gms:play-services-maps:18.0.2)

要回复问题请先登录注册