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

时间:2017-01-30 13:59:58

标签: java android android-studio gradle android-gradle

  

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

这是我的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'
  

错误:任务执行失败   ':应用程序:transformClassesWithJarMergingForDebug'。

     
    

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:     COM /谷歌/机器人/克/ AUTH / API /登入/内部/ zzf.class

  

1 个答案:

答案 0 :(得分:0)

将此添加到您的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
相关问题