google-signin: react-native-google-signin Example not working on Android?

Getting this error when using the Example on Android.

WRONG SIGNIN Error: DEVELOPER_ERROR at new GoogleSigninError (GoogleSignin.android.js:53) at GoogleSignin.android.js:129 at RCTDeviceEventEmitter.emit (EventEmitter.js:181) at MessageQueue.__callFunction (MessageQueue.js:242) at MessageQueue.js:108 at guard (MessageQueue.js:46) at MessageQueue.callFunctionReturnFlushedQueue (MessageQueue.js:107) at debuggerWorker.js:71

Surely the example works? Can’t work out what I’m doing wrong.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 40

Most upvoted comments

same here - anyone solved the problem?

EDIT: Duh - Don’t forget to add the SHA-1 of your debug keystore to firebase.

keytool -exportcert -list -v \
-alias androiddebugkey -keystore ~/.android/debug.keystore

https://developers.google.com/android/guides/client-auth

https://stackoverflow.com/questions/40088741/google-sign-in-error-statusstatuscode-developer-error-resolution-null

+1 same problem here, this is open since 12th of April, nobody could figure out what’s the issue? 🤕

+1 I tried to add SHA to Firebase but it not working too.

@mtt87 thanks, that really helped! For anyone who is using Firebase, this is the equivalent:

Step 1: Get the SHA-1 of your Android Developer Debug Keystore

keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore

The password is android.

Copy the SHA-1 value, which will look something like this in the output:

Certificate Fingerprints
   .... 
   SHA1: aa:bb:cc:dd:ee:ff:11:22:33:44:47:D0:9E:8D:E0:0C:79:F1:0F:CB

Step 2: Add the SHA to the Android App in the Firebase Console

Now open up your Android App in the Firebase console and add the SHA-1:

image

I’ve also posted this solution on Stack Overflow at: https://stackoverflow.com/questions/40088741/google-sign-in-error-statusstatuscode-developer-error-resolution-null/48031335#48031335

I’d suggest for anyone having the same issue, maybe move the discussion there as Stack Overflow answers tend to be better places for discussing how to solve things like config issues like this, leaving the project GitHub issues for code related issues to the project.

@D1no I got it working in debug but when I build the app for production google sign in still does not work, any insight ?

I had to dig everywhere and find out that the SHA1 I was using was wrong.

I think at this point it’s not really related to this library but more how badly Android and the Google APIs work.

I suggest to follow these steps and carefully check what’s your release.keystore https://developers.google.com/android/guides/client-auth

Then make sure that

  1. BOTH Android in API Keys and Oauth2.0 Client IDs have the correct SHA1 signature.
  2. your bundle ID is correct

In Android API key you can add both debug and production SHA1, but on Oauth client you can only add one SHA1 so be careful to use the one you need (debug for testing or production to make your app work) otherwise create separate for debug and production.

screen shot 2017-08-21 at 22 33 40 screen shot 2017-08-21 at 22 33 09

any one having issues with debug mode can watch this vedio it will satisfy you it has complete google login working with react native cli (init version )

link: https://www.youtube.com/watch?v=AHVaxhcoY98&t=124s

make sure that the webcClientId’s type is “web” rather than “android”.

@RileyDavidson-Evans well in release, it of course does not use the debug.keystore.

So you need to create a release keystore https://facebook.github.io/react-native/docs/signed-apk-android.html (General: https://developer.android.com/studio/publish/app-signing.html#sign-apk)

And get its SHA-1 like usual https://developers.google.com/android/guides/client-auth

@D1no Hey sorry I forgot to post back in this thread, I ended up getting everything working!

I was using this with firebase so registering the keys were very straight forward, these are the links I used to get debug and production builds to work:

THIS IS FOR DEBUG BUILD OF APP

https://developers.google.com/android/guides/client-auth

for signing the production build this step by step is exactly what to do

PRODUCTION SIGNING

http://blog.tylerbuchea.com/react-native-publishing-an-android-app/

after configuring you must AGAIN add you SHA-1 key to the firebase console

this seems to be how it can be used in non-firebase applications https://developers.google.com/drive/android/auth

I’ve done every thing mentioned above and even triple checked my androidkeystore SHA-1 and I can’t get it to work. So it got me wondering, do I have to be a registered developer with google to test this out, or I’m I missing something else.