2017-02-19 2 views
1

Hallo Ich erhalte diesen Fehlerjava.util.zip.ZipException auf Retrofit und Gson

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/gson/annotations/Expose.class

Wenn ich die Nachrüstung Gson Konverter meiner gradle hier hinzugefügt ist mein 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') 
} 

Können Sie mir Jungs mit meinem Problem helfen? Danke

Antwort

0

Klasse com.google.gson.annotations.Expose ist in mehr als einer Abhängigkeit definiert. Sie müssen widersprüchliche Abhängigkeiten ausschließen oder entfernen.

Eg. com.squareup.retrofit2:converter-gson:2.1.0 enthält bereits transitive Abhängigkeit com.google.code.gson:gson:2.7, so dass keine Notwendigkeit besteht, auch compile files('libs/gson-2.2.4.jar') zu deklarieren.

Verwandte Themen