在构建我的apk时出错

时间:2017-08-04 08:33:05

标签: java android

这是我的grade.build文件这是错误:

  

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

     
    

com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:     COM /谷歌/机器人/克/普通/ API / zza.class

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

android {`

compileSdkVersion 25
buildToolsVersion "26.0.0"
defaultConfig {
    applicationId "romasakhalid.css"
    minSdkVersion 15
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}
packagingOptions {
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/LICENSE.txt'
}
buildTypes {

    release {

        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

}

dexOptions 
{
preDexLibraries = false
 }
}
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'

    exclude group: 'com.android.support', module: 'support-v4'
})

compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.google.firebase:firebase-core:9.0.0'
compile 'com.google.firebase:firebase-database:9.0.0'
compile 'com.firebaseui:firebase-ui-database:0.6.2'
compile 'com.android.support:recyclerview-v7:25.3.1'


testCompile 'junit:junit:4.12'

1 个答案:

答案 0 :(得分:0)

您可能使用了错误版本的firebase-ui-database。根据{{​​3}},它修复了com.google.firebase版本的依赖关系。这意味着您必须确保com.firebaseui:firebase-ui-database:0.6.2支持com.google.firebase:firebase-core:9.0.0

您可以使用gradle依赖关系树进行检查,或者使用开发人员提供的预定义建议之一,例如

FirebaseUI版本Firebase / Play服务版本
2.2.0 11.0.4
2.1.1 11.0.2
2.0.1 11.0.1
1.2.0 10.2.0
1.1.1 10.0.0或10.0.1
1.0.1 10.0.0或10.0.1
1.0.0 9.8.0