Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.

来源:互联网 发布:滨州行知中学暴力事件 编辑:程序博客网 时间:2024/06/16 01:41

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.


com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry

这种是因为多导入了jar导致的

曾经碰到最多的就是使用retrofit2导入

compile ('com.squareup.retrofit2:converter-gson:2.1.0')
的同时导入了
compile 'com.google.code.gson:gson:2.8.2'
gson相关的jar包
而导致而上错误  
最终的办法是去除包中相同的类
compile ('com.squareup.retrofit2:converter-gson:2.1.0')        {exclude group: 'com.google.code.gson'}
所有这一类的方法都可以通过maven找到依赖 sxclude相对应的依赖实现

阅读全文
0 0