java.util.zip.ZipException: duplicate entry: com/g

2019-06-01 17:45发布

I am using firebase, but can't generate signed APK. I have searched similar problems but solutions don't work for me.

Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'. com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/firebase/iid/zzb.class

My Gradle.build app file

 apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"
    defaultConfig {
        applicationId "com.alpkaanaksu.spqrchatroom"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
configurations{
    all*.exclude group: 'com.google.firebase.iid', module: 'firebase-iid-10.0.1'
    all*.exclude group: 'com.google.firebase.iid', module: 'play-services-tasks-10.0.1'
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.firebaseui:firebase-ui:2.0.1'
    testCompile 'junit:junit:4.12'
}



apply plugin: 'com.google.gms.google-services'

1条回答
戒情不戒烟
2楼-- · 2019-06-01 18:31

Read Firebase UI for Android

FirebaseUI Version   Firebase/Play Services Version
2.0.1                   11.0.1
1.2.0                   10.2.0
1.1.1                   10.0.0 or 10.0.1
1.0.1                   10.0.0 or 10.0.1
1.0.0                   9.8.0

You should use

  compile 'com.google.firebase:firebase-core:11.0.1'
  ompile 'com.firebaseui:firebase-ui:2.0.1'
查看更多
登录 后发表回答