react-native-google-signin / google-signin

Google Sign-in for your React Native applications
https://react-native-google-signin.github.io/
MIT License
3.12k stars 876 forks source link

Multiple dex files define Lcom/google/android/gms/auth/api/signin/internal/zzg #286

Closed gokulkulkarni1987 closed 6 years ago

gokulkulkarni1987 commented 6 years ago

While running android application I am getting the above error,

I checked this SO and many other posts on the net, no help :(

orozcojair commented 6 years ago

I have dealt with this already, in the android guide it calls out this line

compile 'com.google.android.gms:play-services-auth:9.2.1'

when I had 9.2.1 version I had the same issue because i am installing a newer version of play services in my emulator. So I changed it to the current for my version which is 11.0.4

compile 'com.google.android.gms:play-services-auth:11.0.4

that solved it for me

gokulkulkarni1987 commented 6 years ago

@orozcojair I have tried that, it did not work

duyv commented 6 years ago

Waiting a solution !!!

Mahi-K commented 6 years ago

hello there try to update the version as
compile 'com.google.android.gms:play-services-auth:11.6.0'

and see if this works,

Many thanks, Mahi.

raduflp commented 6 years ago

following this guide helped me solve the Multiple dex issues

Mahi-K commented 6 years ago

Hello there, This error basically happens if the google plugins are referring to different versions of play-services.

if this occurs on native android just change the build.gradle(Module: app) file to refer to same version number like 11.6.0 or 11.6.2 but nothing like 11.+,

literally every single dependency that starts with com.google.... needs to be overwritten with just one version only.

if you are developing using react native then the guide suggested by @raduflp is a very good one to override all the dependencies to point to one version,.

if you are using a framework like flutter then open the yourapp/android folder in android studio and you will see build.gradle file for the google plugins like firebase auth, messaging etc and you can edit each one to refer to one version of dependency and this should solve your problem.

Regards, Mahi

Gurjap commented 6 years ago

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

AndreiCalazans commented 6 years ago

Issue seems to be solved thanks to the comments above. Please open a new issue with this problem persists.