我一直在努力爭取更多的一天來修復運行我的android項目時給出的重複條目。zip.ZipException:重複項:註解/ Beta.class
錯誤:
Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.> java.util.zip.ZipException: duplicate entry: com/google/common/annotations/Beta.class
我一直在努力,排除各種模塊以及啓用multiDex,並撞上了一堵牆,請幫我解決這個問題:代碼
部分:
compile(project(path: ':k_endpoint', configuration: 'android-endpoints')) {
exclude(group: 'com.google.guava', module: 'guava-jdk5')
exclude(group: 'com.android.support', module: 'support-annotations')
}
compile ('com.android.support:multidex:1.0.1')
compile ('com.android.support:appcompat-v7:22.2.0')
compile ('com.google.android.gms:play-services:8.1.0')
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile ('com.android.support:cardview-v7:22.2.0')
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'
我已經嘗試在recyclerview和cardview中排除「支持註釋」,因爲兩者似乎都有模塊,但沒有任何幫助。
端點代碼:
dependencies {
compile 'com.google.guava:guava-jdk5:17.0'
appengineSdk ('com.google.appengine:appengine-java-sdk:1.9.19'){
}
compile ('com.google.appengine:appengine-endpoints:1.9.19')
compile ('com.google.appengine:appengine-endpoints-deps:1.9.19')
compile ('javax.servlet:servlet-api:2.5')
compile ('com.googlecode.objectify:objectify:5.1.1')
compile ('com.ganyo:gcm-server:1.0.2')
compile ('com.sendgrid:sendgrid-java:2.2.1'){
exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
exclude(group: 'org.json', module: 'json')
}
我試圖找到與下面的衝突,不知道註釋是正確的模塊首先搜索。
./gradlew -q :app:dependencyInsight --dependency annotations --configuration compile
結果:
+--- com.android.support:recyclerview-v7:22.2.0
| \--- compile
\--- com.android.support:support-v4:22.2.0
+--- com.android.support:appcompat-v7:22.2.0
| +--- compile
| +--- com.android.support:design:22.2.0
| | \--- compile
| \--- com.android.support:mediarouter-v7:22.2.0
| \--- com.google.android.gms:play-services-cast:8.1.0
| \--- com.google.android.gms:play-services:8.1.0
| \--- compile
+--- com.android.support:design:22.2.0 (*)
+--- com.android.support:recyclerview-v7:22.2.0 (*)
\--- com.google.android.gms:play-services-basement:8.1.0
+--- com.google.android.gms:play-services:8.1.0 (*)
+--- com.google.android.gms:play-services-ads:8.1.0
etc
你解決這個問題? –
任何解決這個問題的方法?我也面對這一點,這是非常令人沮喪的。 – user531069
我嘗試了很多東西,但發現我正在調用兩次編譯。它是在底部的方式,所以沒有看到它。但是,重複調用創建了錯誤 – cfl