多个dex文件定义Lcom / google / android / gms / auth / api / signin / internal / zzf; [英] Multiple dex files define Lcom/google/android/gms/auth/api/signin/internal/zzf;

查看:553
本文介绍了多个dex文件定义Lcom / google / android / gms / auth / api / signin / internal / zzf;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误:执行失败的任务':app:transformClassesWithDexForDebug'。

 错误:


> com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:com.android.dex.DexException:多个dex文件定义Lcom / google / android /克/ AUTH / API /登入/内部/ ZZF;

我将这两个依赖关系添加到一起时出现此错误: p>


编译'com.google.firebase:firebase-auth:10.0.1'



compile'c​​om.firebaseui:firebase-ui:0.6.0'


app build.gradle

  apply plugin:'com.android.application'

android {

compileSdkVersion 25
buildToolsVersion25.0.2强调文本
defaultConfig {
applicationIdcom.techstrategies.icall
minSdkVersion 18
targetSdkVersion 25
versionCode 1
versionName1.0
testInstrumentationRunnerandroid.support.test.runner.AndroidJUnitRunner
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard- rules.pro'
}
}

依赖项{

编译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'c​​om.android.support:appcompat-v7:25.0.1'
compile'c​​om.google.firebase:firebase-messaging:10.0.1'
编译'com.google.firebase:firebase-core:10.0.1'
编译'com.google.firebase:firebase-auth:10.0.1'
编译'com.firebaseui:firebase-ui: 0.6.0'
testCompile'junit:junit:4.12'
}




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


解决方案

检查官方文档

您正在使用错误的版本sion

  FirebaseUI版本 - > Firebase / Play服务版本

1.1.1 - > 10.0.0或10.0.1
1.0.1 - > 10.0.0或10.0.1
1.0.0 - > 9.8.0
0.6.2 - > 9.8.0
0.6.1 - > 9.6.1
0.6.0 - > 9.6.0

由于您使用的是

  compile'c​​om.google.firebase:firebase-core:10.0.1'

您必须使用:

  compile'c​​om.firebaseui:firebase-ui:1.1.1'

 编译'com.firebaseui:firebase-ui:1.0.1'

编辑:

另外,由于您正在添加

  allprojects {
版本库{
// ...
maven {url'https://maven.fabric.io/public'}
}
}

检查文档和这个问题。


Error

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/auth/api/signin/internal/zzf;

I get this error when i add these two dependencies together:

compile 'com.google.firebase:firebase-auth:10.0.1'

compile 'com.firebaseui:firebase-ui:0.6.0'

app build.gradle

apply plugin: 'com.android.application'

android {

    compileSdkVersion 25
    buildToolsVersion "25.0.2"emphasized text
    defaultConfig {
        applicationId "com.techstrategies.icall"
        minSdkVersion 18
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

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.0.1'
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'com.google.firebase:firebase-core:10.0.1'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    compile 'com.firebaseui:firebase-ui:0.6.0'
    testCompile 'junit:junit:4.12'
}




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

解决方案

Check the official doc.
You are using the wrong version.

FirebaseUI Version  ->  Firebase/Play Services Version

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
0.6.2 -->   9.8.0
0.6.1  -->  9.6.1
0.6.0  -->  9.6.0

Since you are using

compile 'com.google.firebase:firebase-core:10.0.1'

you have to use:

compile 'com.firebaseui:firebase-ui:1.1.1'

or

compile 'com.firebaseui:firebase-ui:1.0.1'

EDIT:
Also since you are adding the Firebase-UI Auth library you have to add this repository:

allprojects {
    repositories {
        // ...
        maven { url 'https://maven.fabric.io/public' }
    }
}

Check the doc and this issue.

这篇关于多个dex文件定义Lcom / google / android / gms / auth / api / signin / internal / zzf;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆