问题
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'
回答1:
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.
来源:https://stackoverflow.com/questions/42244653/multiple-dex-files-define-lcom-google-android-gms-auth-api-signin-internal-zzf