2017-01-16 83 views
1

我得到這個錯誤,而組裝發佈:的Android Proguard的建立失敗:重複的ZIP條目

警告:異常在處理任務產生java.io.IOException:無法寫入[/用戶/ tuanchauict/PW /Android/xrmovies/app/build/intermediates/transforms/proguard/prod/release/jars/3/1f/main.jar](無法讀取[/ Users/tuanchauict/pw/Android/xrmovies/app/build /中間體/類/ prod/release(;;;;;; **。class)](複製zip條目[android/support/v7/a/a $ a.class == android/support/v7/appcompat/R $ attr.class])) :app:transformClassesAndResourcesWithProguardForProdRelease FAILED

這是堆棧跟蹤:

Caused by: java.io.IOException: Can't write [/Users/tuanchauict/pw/Android/xrmovies/app/build/intermediates/transforms/proguard/prod/release/jars/3/1f/main.jar] (Can't read [/Users/tuanchauict/pw/Android/xrmovies/app/build/intermediates/classes/prod/release(;;;;;;**.class)] (Duplicate zip entry [android/support/v7/a/a$a.class == android/support/v7/appcompat/R$attr.class])) 
     at proguard.OutputWriter.writeOutput(OutputWriter.java:187) 
     at proguard.OutputWriter.execute(OutputWriter.java:79) 
     at proguard.ProGuard.writeOutput(ProGuard.java:427) 
     at proguard.ProGuard.execute(ProGuard.java:175) 
     at com.android.build.gradle.internal.transforms.BaseProguardAction.runProguard(BaseProguardAction.java:54) 
     at com.android.build.gradle.internal.transforms.ProGuardTransform.doMinification(ProGuardTransform.java:254) 
     at com.android.build.gradle.internal.transforms.ProGuardTransform.access$000(ProGuardTransform.java:63) 
     at com.android.build.gradle.internal.transforms.ProGuardTransform$1.run(ProGuardTransform.java:173) 
     at com.android.builder.tasks.Job.runTask(Job.java:49) 
     at com.android.build.gradle.tasks.SimpleWorkQueue$EmptyThreadContext.runTask(SimpleWorkQueue.java:41) 
     at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:223) 
Caused by: java.io.IOException: Can't read [/Users/tuanchauict/pw/Android/xrmovies/app/build/intermediates/classes/prod/release(;;;;;;**.class)] (Duplicate zip entry [android/support/v7/a/a$a.class == android/support/v7/appcompat/R$attr.class]) 
     at proguard.InputReader.readInput(InputReader.java:188) 
     at proguard.InputReader.readInput(InputReader.java:158) 
     at proguard.OutputWriter.writeOutput(OutputWriter.java:176) 
     ... 10 more 
Caused by: java.io.IOException: Duplicate zip entry [android/support/v7/a/a$a.class == android/support/v7/appcompat/R$attr.class] 
     at proguard.io.JarWriter.getOutputStream(JarWriter.java:138) 
     at proguard.io.FilteredDataEntryWriter.getOutputStream(FilteredDataEntryWriter.java:105) 
     at proguard.io.FilteredDataEntryWriter.getOutputStream(FilteredDataEntryWriter.java:105) 
     at proguard.io.FilteredDataEntryWriter.getOutputStream(FilteredDataEntryWriter.java:92) 
     at proguard.io.ClassRewriter.read(ClassRewriter.java:68) 
     at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87) 
     at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87) 
     at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87) 
     at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87) 
     at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87) 
     at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87) 
     at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87) 
     at proguard.io.FilteredDataEntryReader.read(FilteredDataEntryReader.java:87) 
     at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:65) 
     at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:74) 
     at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:74) 
     at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:74) 
     at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:74) 
     at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:74) 
     at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:53) 
     at proguard.InputReader.readInput(InputReader.java:184) 
     ... 12 more 


BUILD FAILED 

我已經搜索周圍,但沒有辦法解決這種情況。

我的依賴關係:

compile 'com.android.support:appcompat-v7:25.1.0' 
compile 'com.android.support:support-v4:25.1.0' 
compile 'com.android.support:recyclerview-v7:25.1.0' 
compile 'com.android.support:cardview-v7:25.1.0' 
compile 'com.android.support:design:25.1.0' 

compile 'com.google.android.gms:play-services-ads:10.0.1' 
compile 'com.google.android.gms:play-services-analytics:10.0.1' 
compile 'com.google.firebase:firebase-core:10.0.1' 
compile 'com.google.firebase:firebase-crash:10.0.1' 
+0

沒有proguard一切順利嗎? – firegloves

+0

是的,我可以在調試模式下運行 –

+0

你如何刪除它?發佈您的解決方案,爲未來的用戶:) – firegloves

回答

0

(發佈代表OP)的

我已經找出問題出在哪裏。我使用第三方庫,它包含支持庫中的R類。將它移除並且構建工作。

相關問題