2017-06-20 73 views
1

我正在使用Firebase,但無法生成已簽名的APK。我搜索了類似的問題,但解決方案不適合我。java.util.zip.ZipException:重複條目:com/google/firebase/iid/zzb.class

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

我Gradle.build app文件

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' 
+0

顯然是因爲衝突在firebase-ui的版本和firebase本身之間...詢問bazillion時間...還有關於哪些版本的firebase-ui適合哪個版本的firebase明確的文檔 – Selvin

回答

3

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 

您應該使用

compile 'com.google.firebase:firebase-core:11.0.1' 
    ompile 'com.firebaseui:firebase-ui:2.0.1' 
+0

@Selvin Ji謝謝信息 –

+1

謝謝,解決了我的問題! –

相關問題