Android packageReleaseError:在打包APK期间重复文件

时间:2016-03-22 03:24:09

标签: android gradle aar

我检查了其他答案,但它似乎对我不起作用。问题是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文件。

0 个答案:

没有答案