问题描述
我一直在使用 Gradle Android 插件 v0.12,但我决定升级到新版本,因为我需要新功能(而且速度提高总是一个优点).
I've been using the Gradle Android plugin v0.12 but I decided to upgrade to the new version, because I needed the new functionality (and the improved speed is always a plus).
更新到新的 v0.13.1 后,我一直收到Duplicate Zip Entry"(来自 Proguard),而之前一切正常.完整的错误:
After updating to the new v0.13.1, I keep getting the "Duplicate Zip Entry" (from Proguard) while everything worked before. The full error:
java.io.IOException: Can't write [/Users/.../classes-proguard/netherlands/release/classes.jar] (Can't read [/Users/.../.gradle/caches]/modules-2/files-2.1/org.apache.commons/commons-io/1.3.2/b6dde38349ba9bb5e6ea6320531eae969985dae5/commons-io-1.3.2.jar(;;;;;;!META-INF)/MANIFEST](重复的 zip 条目 [commons-io-1.3.2.jar:org/apache/commons/io/CopyUtils.class]))(CopyUtils 之前是 FileUtils).
我正在使用以下打包选项:packagingOptions
I'm using following packaging options: packagingOptions
{
exclude 'AndroidManifest.xml'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/MANIFEST.MF'
exclude '!META-INF/MANIFEST.MF'
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
如您所知,我不包括清单文件...
As you can tell, I'm excluding the manifest files...
只是为了测试它,我改回了 0.12.0 版,一切又正常了,回到 0.13.* 后它坏了(但我需要 0.13.*)!
Just to test it, I changed back to version 0.12.0 and everything works again, back to 0.13.* and it breaks (but I need 0.13.*)!
此外,我正在使用以下库:
Further, I'm using the following libraries:
- Robospice
- 改造
- OkHttp
- 飞镖
- 冰镐
- 黄油刀
- 面包块
- SmoothProgressBar
- NineoldsAndroid(在 BetterPickers 库中)
有人也遇到过这个问题吗?如果是这样,任何人都可以帮助我(现在在这个问题上已经打破了我的头 2 天!)?谢谢!
Did anyone encounter this issue too? If so, can anyone please help me out (been breaking my head for 2 days on this issue now!)? Thanks!
推荐答案
我在更新到 Android Gradle 插件 0.13 时遇到了同样的问题.我设法通过在我的 build.gradle
文件中以这种方式包含 retrofit
来修复它:
I had the same issue when updating to Android Gradle plugin 0.13. I managed to fix it by including retrofit
this way in my build.gradle
file:
compile('com.squareup.retrofit:retrofit:1.6.1') {
exclude group: 'commons-io', module: 'commons-io'
}
并且可以在所有 retrofit
和 robospice
依赖项上立即执行此操作:
And can do this on all retrofit
and robospice
dependcies at once with:
compile('com.octo.android.robospice:robospice-retrofit:1.4.14') {
exclude group: 'commons-io', module: 'commons-io'
}
它将自动获取所有底层依赖项(retrofit
、robospice-core
、robospice-cache
、...).
It will get all underlying dependencies automatically (retrofit
, robospice-core
, robospice-cache
, ...).
这篇关于Gradle Plugin v0.13.1 后的重复 Zip 条目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!