这是我的build.gradle。我收到了错误
错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败。 com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / google / android / gms / auth / api / signin / internal / zzf.class
我尝试了许多针对类似问题的解决方案,但没有任何效果。我该如何解决?
apply plugin: 'com.android.application'
repositories {
mavenLocal()
flatDir {
dirs 'libs'
}
}
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.google.firebase.udacity.friendlychat"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
multiDexEnabled true
//all*.exclude group: 'com.android.support', module: 'support-v4'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
dexOptions{
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:appcompat-v7:25.1.0'
// Displaying images
compile 'com.github.bumptech.glide:glide:3.6.1'
//compile 'com.google.firebase:firebase-database:9.8.0'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
// FirebaseUI
compile 'com.firebaseui:firebase-ui-auth:0.6.0'
}
apply plugin: 'com.google.gms.google-services'
答案 0 :(得分:0)
compile ('com.google.firebase:firebase-database:10.0.1'){
exclude group: 'com.google.android', module: 'google-gms'
}
在fire base依赖项中尝试这样的类型。我不确定,但可以解决。
答案 1 :(得分:0)
不知何故,它对我有用!我只是改变了
的依赖关系compile 'com.google.firebase:firebase-database:10.0.1' compile 'com.google.firebase:firebase-auth:10.0.1'
到
compile 'com.google.firebase:firebase-database:9.6.0' compile 'com.google.firebase:firebase-auth:9.6.0'