这几个依赖包,如果不放到Android目录下,打包可以成功,运行不报错但运行调用打印时没输出。如果放到Android目录下,打包又出现错误而失败:
以下依赖包:
android-gif-drawable-release@1.2.23.aar
aps-release.aar
lib.5plus.base-release.aar
oaid_sdk_1.0.25.aar
uniapp-v8-release.aar
*****以下是报错
1: Task failed with an exception.
- What went wrong:
Execution failed for task ':app:mergeReleaseNativeLibs'.A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
2 files found with path 'lib/x86_64/libweexjst.so' from inputs: - /srv/.gradle/caches/transforms-3/717e68a75170e52e72ac72ee78c0202c/transformed/jetified-dc_weexsdk_v8-release/jni
- /srv/.gradle/caches/transforms-3/6739cee0aa0047490c4795b5dad90e6f/transformed/jetified-uniapp-v8-release/jni
If you are using jniLibs and CMake IMPORTED targets, see
https://developer.android.com/r/tools/jniLibs-vs-imported-targets
报错原文:
https://ide.dcloud.net.cn/build/errorLog/01ebd580-13b4-11ed-af19-6be656bb9bff
onmyway911 (作者)
谢谢,我在尝试,也试试赞助的头像出来没,哈哈哈
2022-08-04 17:03
onmyway911 (作者)
插件都是用compileOnly修饰的,仍然是报这些错:
compileOnly files('libs\CH34xUARTDriver.jar')
compileOnly files('libs\uhf.jar')
compileOnly files('libs\core.jar')
compileOnly files('libs\DP_SerialportList_1.32.jar')
compileOnly fileTree(dir: 'libs', include: ['.jar'])
compileOnly fileTree(dir: 'libs', include: ['.aar'])
2022-08-05 16:42
onmyway911 (作者)
报错内容:
Appid: UNI78D4F87
FAILURE: Build completed with 3 failures.
1: Task failed with an exception.
Execution failed for task ':app:checkReleaseDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class XI.CA.XI.K0 found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.CA.XI.K0$XI found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.CA.XI.XI found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.CA.XI.kM found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.K0.XI.XI found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.K0.XI.XI$K0 found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.K0.XI.XI$K0$K0 found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.K0.XI.XI$K0$XI found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.K0.XI.XI$XI found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.K0.XI.XI$XI$XI found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.XI.K0.K0 found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.XI.K0.K0$XI found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.XI.K0.XI found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.XI.K0.kM found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.XI.K0.xo found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.XI.XI.XI found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.XI.XI.XI$XI found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.XI.XI.XI$XI$XI found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.kM.XI.XI.XI.K0 found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.kM.XI.XI.XI.XI found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.kM.XI.XI.XI.XI$XI found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.xo.XI.XI.CA found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.xo.XI.XI.K0 found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.xo.XI.XI.XI found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.xo.XI.XI.kM found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class XI.xo.XI.XI.xo found in modules jetified-base_oaid_sdk-runtime (base_oaid_sdk.aar) and jetified-base_oaid_sdk-runtime (oaid_sdk_1.0.25.aar)
Duplicate class com.alibaba.android.bindingx.core.BindingXCore found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.BindingXCore$1 found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.BindingXCore$2 found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.BindingXCore$3 found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.BindingXCore$JavaScriptCallback found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.BindingXCore$ObjectCreator found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.BindingXEventType found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.BindingXJSFunctionRegister found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.BindingXPropertyInterceptor found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.BindingXPropertyInterceptor$1 found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.BindingXPropertyInterceptor$IPropertyUpdateInterceptor found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.BuildConfig found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.IEventHandler found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.IEventInterceptor found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.LogProxy found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.PlatformManager found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.PlatformManager$1 found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.PlatformManager$Builder found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.PlatformManager$IDeviceResolutionTranslator found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.PlatformManager$IViewFinder found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.PlatformManager$IViewUpdater found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.WeakRunnable found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.AbstractEventHandler found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.AbstractEventHandler$Cache found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.AbstractScrollEventHandler found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.AnimationFrame found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.AnimationFrame$Callback found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.AnimationFrame$ChoreographerAnimationFrameImpl found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.AnimationFrame$HandlerAnimationFrameImpl found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.BindingXConstants found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.BindingXConstants$State found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.BindingXOrientationHandler found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.BindingXOrientationHandler$ValueHolder found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.BindingXTimingHandler found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.BindingXTouchHandler found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.Euler found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.Expression found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.ExpressionHolder found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.ExpressionPair found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.JSFunctionInterface found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.JSMath found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.JSMath$1 found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.JSMath$10 found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.JSMath$11 found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.JSMath$12 found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.JSMath$13 found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.JSMath$14 found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.JSMath$15 found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.JSMath$16 found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
Duplicate class com.alibaba.android.bindingx.core.internal.JSMath$17 found in modules jetified-dc_weexsdk_v8-release-runtime (dc_weexsdk_v8-release.aar) and jetified-uniapp-v8-release-runtime (uniapp-v8-release.aar)
2022-08-05 16:43
DCloud_Android_ST
回复 onmyway911: 插件libs里不要官方提供的依赖aar 仔细看文档只放你插件需要的 。其次关于oaid的依赖库你只能使用我们提供的oaid_sdk_1.0.25.aar
2022-08-05 17:42
onmyway911 (作者)
回复 DCloud_Android_ST: 把官方提供的依赖aar全部删除,打包通过且无错,但调硬件的方法能执行却调不起硬件。所以才想模仿无错的Android Studio照主APP的引用来。
2022-08-05 18:43
DCloud_Android_ST
回复 onmyway911: 日志指向也很明显 就是依赖库重复了。 你本地测试如果通过 云打包后失效大概率是确实插件需要的依赖库
2022-08-05 19:10
onmyway911 (作者)
回复 DCloud_Android_ST: 是的,关键是本地测试通过,云打包不报错但硬件调用失效,所以在尝试各种办法,谢啦
2022-08-05 19:51