Multiple dex files define Lcom/google/android/gms/internal/zzau

前端 未结 14 1129
[愿得一人]
[愿得一人] 2020-11-29 10:55

I get the error com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzau; when i run my app The gradle files are

ap

相关标签:
14条回答
  • 2020-11-29 11:20

    I had this issue recently, the reason was the version difference:

    'com.google.firebase:firebase-ads:9.0.6'
    
    'com.google.firebase:firebase-crash:11.0.2'
    

    so make sure you have the same version.

    0 讨论(0)
  • 2020-11-29 11:21

    Firebase Android SDKs now have independent version numbers, allowing for more frequent, flexible updates.

    Update all your Firebase dependencies to the latest version (as of 2 May 2018):

     Firebase Core          com.google.firebase:firebase-core:15.0.2
        Ads                 com.google.firebase:firebase-ads:15.0.0
      Analytics             com.google.firebase:firebase-analytics:15.0.2
     App Indexing           com.google.firebase:firebase-appindexing:15.0.0
     Authentication         com.google.firebase:firebase-auth:15.1.0
    Cloud Firestore         com.google.firebase:firebase-firestore:16.0.0
    Cloud Functions         com.google.firebase:firebase-functions:15.0.0
    Cloud Messaging         com.google.firebase:firebase-messaging:15.0.2
    Cloud Storage           com.google.firebase:firebase-storage:15.0.2
    Crash Reporting         com.google.firebase:firebase-crash:15.0.2
    Crashlytics             com.crashlytics.sdk.android:crashlytics:2.9.1
    Invites                 com.google.firebase:firebase-invites:15.0.2
    Performance Monitoring  com.google.firebase:firebase-perf:15.1.0
    Realtime Database       com.google.firebase:firebase-database:15.0.0
    Remote Config           com.google.firebase:firebase-config:15.0.2
    

    Release note: https://firebase.google.com/support/release-notes/android

    0 讨论(0)
  • 2020-11-29 11:22

    I had the same problem but mine was cause by firebase-ui newest version 2.0.0. So I downgraded to 1.2.0 and added the following line to Project level build.gradle file:

    allprojects {
        repositories {
            jcenter()
    
            // Add the following code
            maven {
                url 'https://maven.fabric.io/public'
            }
        }
    }
    
    0 讨论(0)
  • 2020-11-29 11:23

    I encountered the same issue after manually adding Firebase to my app.
    For me the solution was changing:

    classpath 'com.google.gms:google-services:3.2.0'
    

    to:

    classpath 'com.google.gms:google-services:3.0.0'
    

    in the root-level build.gradle file.

    0 讨论(0)
  • 2020-11-29 11:29

    I had a similar problem after building using phonegap/cordova: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzsk;

    I fixed it by editing build.gradle(module Android), as I had 2 libraries that should have the exact same version with different version numbers (8.4.0 and 9.2.1 in my case)

    dependencies{
    ....
    //make sure are both same version (8.4.0 or 9.2.1 in my case)
    compile 'com.google.android.gms:play-services-gcm:9.2.1'
    // this is the one I changed:  compile 'com.google.android.gms:play-services-location:8.4.0'
    compile 'com.google.android.gms:play-services-location:9.2.1' // it was 8.4.0
    ....
    }
    
    0 讨论(0)
  • 2020-11-29 11:30

    If anyone had the same issues as mine, I removed the firebase-core dependency and it worked like a charm.

    dependencies{
        implementation 'com.google.firebase:firebase-core:15.0.0'
        implementation 'com.google.android.gms:play-services-ads:15.0.0'
        implementation 'com.google.firebase:firebase-crash:15.0.0'
        implementation 'com.google.firebase:firebase-messaging:15.0.0'
    }
    

    to

    dependencies{
        implementation 'com.google.android.gms:play-services-ads:15.0.0'
        implementation 'com.google.firebase:firebase-crash:15.0.0'
        implementation 'com.google.firebase:firebase-messaging:15.0.0'
    }
    
    0 讨论(0)
提交回复
热议问题