報錯com.android.build.api.transform.TransformException: java.util.zip.ZipException:

蘇打水解渴發表於2018-05-08

在打包的時候出現打包失敗,於是通過日誌發現如下錯誤

* What went wrong:
[2018-05-07 20:08:11,121] DEBUG Thread-2773 //opt/local/share/apache-tomcat-7.0.32/logs//0EP/ort/al/EPortal-android - Execution failed for task ':transformClassesWithJarMergingForRelease'.
[2018-05-07 20:08:11,121] DEBUG Thread-2773 //opt/local/share/apache-tomcat-7.0.32/logs//0EP/ort/al/EPortal-android - > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/slidingmenu/lib/app/SlidingActivity.class

通過日誌可以知道是在打包的時候出現了zip異常,可以推斷出是因為com/slidingmenu/lib/app/SlidingActivity.class 這個類衝突了,那就是可能有兩個一樣的類,於是就把重點放在jar重複上,終於找到了兩個一樣jar刪除一個就ok

相關文章