我正在使用改造,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和重建項目 –