重复条目:gms / auth / api / signin / internal / zzf.class

在询问问题之前,我搜索了答案

这是我的gradle文件

apply plugin: 'com.android.application' android { compileSdkVersion 24 buildToolsVersion "24.0.2" defaultConfig { applicationId "a.thenotebook" minSdkVersion 16 targetSdkVersion 24 versionCode 1 versionName "1.0" multiDexEnabled true } buildTypes { debug { debuggable true } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:25.1.0' compile 'com.android.support:design:25.1.0' compile 'com.google.firebase:firebase-auth:10.0.1' compile 'com.google.firebase:firebase-database:10.0.1' compile 'com.android.support:cardview-v7:25.1.0' compile 'com.android.support:recyclerview-v7:25.1.0' compile 'com.firebaseui:firebase-ui:1.0.0' compile 'com.google.firebase:firebase-appindexing:10.0.1' testCompile 'org.testng:testng:6.9.6' compile 'com.android.support:support-v4:25.1.0' } } apply plugin: 'com.google.gms.google-services' 

错误:任务’:app:transformClassesWithJarMergingForDebug’的执行失败。

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / google / android / gms / auth / api / signin / internal / zzf.class

将其添加到build.gradle

 task findJarsContaining { doLast { def jarTree = configurations.runtime.asFileTree.matching { include '*.jar' } jarTree.files.each { jarFile -> def matches = zipTree(jarFile).matching { include 'com/google/android/gms/auth/api/signin/internal/zzf.class' }.files if (matches) { println "Found $matches.size() matches in $jarFile.name" } } } } 

然后跑

 gradle findJarsContaining