2017-06-11 243 views
0

錯誤:任務':app:transformClassesWithDexForDebug'的執行失敗。構建APK時彈出錯誤

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/zzg;

當我打算構建APK時顯示此錯誤消息。 這是什麼意思?我該如何解決它?

這是我的依賴關係:

compile 'com.android.support:appcompat-v7:25.3.1' 
compile 'com.google.android.gms:play-services-maps:10.2.0' 
compile 'com.android.support:design:25.3.1' 
compile 'com.google.firebase:firebase-database:10.2.0' 
compile 'com.android.support.constraint:constraint-layout:1.0.2' 
compile 'com.android.support:support-v4:25.3.1' 
compile 'com.android.support:support-vector-drawable:25.3.1' 
compile 'com.google.firebase:firebase-auth:10.2.0' 
compile 'com.google.firebase:firebase-storage:10.2.0' 
compile 'com.squareup.picasso:picasso:2.5.2' 
compile 'com.github.sillebille:dynamic-calendar:1.0.1' 
compile 'com.mcxiaoke.volley:library:1.0.19' 
compile 'com.firebaseui:firebase-ui:0.6.2' 
testCompile 'junit:junit:4.12' 
+0

你有很多的庫。看到這個文檔https://developer.android.com/studio/build/multidex.html –

+0

@Ludy阿斯特拉德國我做到了,仍然沒有工作。任何想法還有什麼呢? –

回答

0

變化'com.firebaseui:火力的UI:0.6.2''com.firebaseui:火力的UI:1.2.0'並添加編譯 'com.android.support:multidex:1.0.1'

應用的build.gradle

android { 
    defaultConfig { 
     // whats ever 
     multiDexEnabled true 
    } 
} 

// whats ever 

dependencies { 
    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.google.android.gms:play-services-maps:10.2.0' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.google.firebase:firebase-database:10.2.0' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.android.support:support-v4:25.3.1' 
    compile 'com.android.support:support-vector-drawable:25.3.1' 
    compile 'com.google.firebase:firebase-auth:10.2.0' 
    compile 'com.google.firebase:firebase-storage:10.2.0' 
    compile 'com.squareup.picasso:picasso:2.5.2' 
    compile 'com.github.sillebille:dynamic-calendar:1.0.1' 
    compile 'com.mcxiaoke.volley:library:1.0.19' 
    compile 'com.firebaseui:firebase-ui:1.2.0' 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:multidex:1.0.1' 
} 

並在項目中加入的build.gradle

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

AndroidManifest.xml中

<application 
    android:name="android.support.multidex.MultiDexApplication" 
+0

它工作!非常感謝你 ! –

相關問題