我想包括火力地堡认证(具体而言,使用FirebaseUI验证电子邮件/密码认证)的一个项目。由于我是新手,因此我正在使用一本书(“Firebase Essentials Android版”)的示例。他们的工作预期,问题出现时,我被迫使用:DexException与FirebaseUI:com.android.dex.DexException:多个DEX文件定义LCOM /谷歌/机器人/克/内部/ zzeg;
compile 'com.google.firebase:firebase-auth:11.2.0'
而不是版本11.0.4
书中(为了使用谷歌地图)建议。注销和删除帐户的功能停止工作。
我搜索信息和我试图更新所有我可以。我正在使用Android Studio 2.3.3。目前,我有以下build.gradle
脚本:
项目的build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
应用的build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.doov.firetest"
minSdkVersion 16
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(include: ['*.jar'], dir: 'libs')
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:26.0.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:11.2.0'
compile 'com.firebaseui:firebase-ui:2.0.1'
compile 'com.firebaseui:firebase-ui-auth:2.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
但是,当我建我得到下一个错误(我在其他时间看到他们,这就是为什么我提出了一个“通用”问题,可能可以解决所有这些类型的问题):
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/internal/zzeg;
我该如何解决?
非常感谢您在这件事上的时间和协助。
当你看到'com.android.dex.DexException:多DEX文件定义X'你应该执行'gradlew应用:依赖--configuration releaseCompileClasspath'。输出有助于找到解决方案 – DeKaNszn