我正在使用Firebase构建一个应用程序,但是遇到了重复类错误。我已经检查了所有依赖项,但是无法确定我在哪里有两个版本的Firebase库。错误信息如下:
执行任务“: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'
}
我通常会在Android Studio中搜索重复的文件来解决这类错误。当我在Android Studio中搜索class zzb时,我得到了一个含有所有其他10.2.1 firebase classes的jar包firebase-iid-9.0.0。我无法找出哪个依赖项注入了这个firebase-iid-9.0.0 jar包?有什么想法吗?
gradle
依赖项 - http://stackoverflow.com/questions/42945613/how-to-find-out-which-library-includes-which-support-library-version/42945708#42945708 - user2756345