我检查了其他答案,但它似乎对我不起作用。问题是gradle抱怨文件重复,建议的排除不起作用
这里是追踪:
:app:packageReleaseError: duplicate files during packaging of APK /home/ubuntu/libprojectB/androidSample/MyTestApp/app/build/outputs/apk/app-release-unsigned.apk
> Building 96% > :app:packageRelease
> Building 96% > :app:packageRelease Path in archive: lib/armeabi-v7a/libprojectA.so
> Building 96% > :app:packageRelease
> Building 96% > :app:packageRelease Origin 1: /home/ubuntu/libprojectB/androidSample/MyTestApp/app/src/main/jniLibs/armeabi-v7a/libprojectA.so
> Building 96% > :app:packageRelease
> Building 96% > :app:packageRelease Origin 2: /home/ubuntu/libprojectB/androidSample/MyTestApp/app/build/intermediates/exploded-aar/com.snapchat/libprojectB/0.3.52.1/jni/armeabi-v7a/libprojectA.so
> Building 96% > :app:packageRelease
> Building 96% > :app:packageReleaseYou can ignore those files in your build.gradle:
> Building 96% > :app:packageRelease
> Building 96% > :app:packageRelease android {
> Building 96% > :app:packageRelease
> Building 96% > :app:packageRelease packagingOptions {
> Building 96% > :app:packageRelease
> Building 96% > :app:packageRelease exclude 'lib/armeabi-v7a/libprojectA.so'
> Building 96% > :app:packageRelease
> Building 96% > :app:packageRelease }
> Building 96% > :app:packageRelease
> Building 96% > :app:packageRelease }
> Building 96% > :app:packageRelease
> Building 96% > :app:packageRelease:app:packageRelease
但即使我确实添加了packagingOption
,它仍然会抱怨这个问题。我做错了什么?
我的项目设置基本上是我将projectA
编译成*.so
文件,我尝试在projectA
中使用projectB
原生文件,但是{{ 1}}也会编译成projectB
文件。