我正在开发一个图书馆项目,该项目也可以处理应用内购买。所以我要包含IInAppBillingService.aidl
文件以及IabHelper
类。
问题是,当我的libarary用户也使用另一个使用IInAppBillingService.aidl
界面的第三方库时。
然后他得到了重复的zip条目错误:
java.io.IOException: Can't write [app/build/intermediates/transforms/proguard/debug/jars/3/1f/main.jar] (Can't read [app/build/intermediates/classes/debug(;;;;;;**/*.class)] (Duplicate zip entry [com/android/vending/billing/IInAppBillingService.class]))
将-injars libs/mylib.aar(!com/android/vending/billing/IInAppBillingService.class)
添加到他的proguard-rules.txt
无济于事。
如何解决这个问题?
答案 0 :(得分:0)
您正在使用包含重复文件的库,这是gradle中的错误,解决在项目build.gradle中使用它的问题
android {
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude '.readme'
}
}
答案 1 :(得分:0)
如果具有重复文件的库在android{}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/DEPENDENCIES'
exclude '.readme'
}