[英]java.util.zip.ZipException on Retrofit and GSON
嗨,我收到此错误
错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败。 com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / google / gson / annotations / Expose.class
当我将改装的GSON转换器添加到我的gradle中时,这是我的gradle。
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/GenAsync.1.2.jar')
compile files('libs/gson-2.2.4.jar')
compile files('libs/KGJsonConverter.jar')
compile files('libs/MD5Simply.jar')
compile files('libs/PhotoUtil.jar')
compile files('libs/android-viewbadger.jar')
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
testCompile 'junit:junit:4.12'
compile files('libs/retrofit-2.1.0.jar')
}
你可以帮我解决我的问题吗? 谢谢
com.google.gson.annotations.Expose
类在多个依赖项中定义。 您需要排除或删除冲突的依赖项。
例如。 com.squareup.retrofit2:converter-gson:2.1.0
已经包含传递依赖com.google.code.gson:gson:2.7
所以没有必要声明也compile files('libs/gson-2.2.4.jar')
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.