Reputation: 1
I get this error when I try to build my app in Android Studio
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: retrofit2/BuiltInConverters$BufferingResponseBodyConverter.class
Here are my dependencies:
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.google.firebase:firebase-core:9.0.2'
compile 'com.google.firebase:firebase-analytics:9.0.2'
compile 'com.google.firebase:firebase-config:9.0.2'
compile 'com.google.firebase:firebase-auth:9.0.2'
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.google.android.gms:play-services-appindexing:9.0.2'
compile 'com.google.firebase:firebase-database:9.0.2'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.google.android.gms:play-services-maps:9.0.2'
compile 'com.android.support.constraint:constraint-layout:+'
compile 'com.android.support:multidex:1.0.1'
Upvotes: 0
Views: 179
Reputation: 45500
What you showed looks good.
According to the error, you have duplicate converter class.
Remove any retrofit jars in you libs folder, then run gradle build again
Upvotes: 1
Reputation: 717
It seems like some jar files are not compiled properly.
Try to clean or Rebuild the project
If it doesn't help than remove the jar file and try to add it again
I am sure it will help
Upvotes: 2
Reputation: 594
Remove the gson library u have added separately. Only the one with the retrofit is required.
Upvotes: 0