I am building an application with firebase but getting the Duplicate class error. I have checked all dependencies, but I'm not able to figure out where did I have two version of firebase libs. Error: Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/firebase/iid/zzb$1.class
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 25
buildToolsVersion '24.0.3'
defaultConfig {
applicationId "com.android.palmtickle"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
//Enabling multiDex support.
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
maven {
url 'http://dl.bintray.com/amulyakhare/maven'
}
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
compile('com.digits.sdk.android:digits:2.0.6@aar') {
transitive = true;
}
//support and app compatibility libs
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support:design:25.3.0'
compile 'com.android.support:cardview-v7:25.3.0'
compile 'com.android.support:recyclerview-v7:25.3.0'
compile 'com.android.support:support-v4:25.3.0'
compile 'com.google.code.gson:gson:2.7'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'de.hdodenhof:circleimageview:2.0.0'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.wdullaer:materialdatetimepicker:2.1.1'
//entries related to firebase
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.firebase:firebase-database:10.2.1'
compile 'com.google.guava:guava-base:r03'
compile 'com.yalantis:ucrop:2.2.0-native'
}
As I always try to solve errors like this by searching duplicate files in Android Studio. When I search class zzb in android studio, I am getting a jar firebase-iid-9.0.0 with all other 10.2.1 firebase classes. I am not able to find out which dependency is injecting this firebase-iid-9.0.0 jar? Any idea?