我正在使用改造,rxjava
和gson
为api
调用。在构建或清理应用程序时,我没有收到任何错误,但只要我在设备中运行应用程序;我得到错误,即通过使用Gson与Retrofit重复输入错误
**错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败。
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/gson/annotations/Expose.class**
depedencies文件应用的build.gradle是:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.android.support:cardview-v7:24.0.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.billingclient:billing:dp-1'
compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'io.reactivex:rxandroid:1.2.0'
compile 'io.reactivex:rxjava:1.1.8'
}
注:我已经尝试了计算器给出像改造及所有除GSON许多解决方案。 请提前帮助感谢。
你尝试从改造排除 'GSON' 的依赖? –
是的,我试过那个已经 –
尝试删除Multidex和重建项目 –