我得到一個錯誤,當我嘗試創建簽名的APK使用Proguard的激活,相對於與改造重複ZIP條目:重複ZIP條目改裝的1.3.0
Note: there were 110 duplicate class definitions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
Warning:can't write resource [.readme] (Duplicate zip entry [classes.jar:.readme])
Warning:can't write resource [META-INF/LICENSE.txt] (Duplicate zip entry [commons-lang3-3.2.1.jar:META-INF/LICENSE.txt])
Warning:can't write resource [META-INF/NOTICE.txt] (Duplicate zip entry [commons-lang3-3.2.1.jar:META-INF/NOTICE.txt])
Warning:can't write resource [META-INF/LICENSE.txt] (Duplicate zip entry [commons-io-1.3.2.jar:META-INF/LICENSE.txt])
Warning:can't write resource [META-INF/NOTICE.txt] (Duplicate zip entry [commons-io-1.3.2.jar:META-INF/NOTICE.txt])
Warning:can't write resource [.readme] (Duplicate zip entry [classes.jar:.readme])
:app:proguardAppRelease FAILED
Error:Execution failed for task ':app:proguardAppRelease'.
> java.io.IOException: Can't write [/Users/me/Projects/myProject/app/build/intermediates/classes-proguard/app/release/classes.jar] (Can't read [/Users/me/Projects/myProject/app/build/intermediates/exploded-aar/myProject/mySubProject/unspecified/jars/libs/retrofit-1.3.0.jar(;;;;;;!META-INF/MANIFEST.MF)] (Duplicate zip entry [b/a/a.class == retrofit-1.3.0.jar:retrofit/android/AndroidApacheClient.class]))
這裏我在我的build.gradle依賴關係:
dependencies {
compile 'joda-time:joda-time:2.7'
compile 'com.android.support:multidex:1.0.0'
compile 'com.android.support:support-v4:19.1.0'
compile 'com.google.code.gson:gson:2.2.4'
compile('com.octo.android.robospice:robospice-retrofit:1.4.11') {
exclude group: 'commons-io', module: 'commons-io'
}
compile('com.squareup.okhttp:okhttp:1.5.4')
compile 'com.google.android.gms:play-services:5.0.89'
compile 'com.splunk.mint:mint:4.0.5'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/PushLinkAndroid-5.3.0.jar')
compile project(':mobihelp_sdk_android_v1.5.4')
}
而且我也已經加入此packaginOptions:
packagingOptions {
exclude '.readme'
exclude 'LICENSE.txt'
exclude 'README.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/MANIFEST.MF'
}
我想知道這是否是p&可能通過從我的編譯中排除retrofit-1.3.0來解決這個問題('com.octo.android.robospice:robospice-retrofit:1.4.11'),或者如果有另一個更好的解決方案。
我已經添加這在我的build.gradle,但它仍然無法正常工作。 – AlexDG
添加完這個後,你做了「乾淨的項目」嗎? –
是乾淨和重建。仍然得到相同的錯誤。我想我必須排除這個重複的zip條目,但不知道如何。 – AlexDG