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

Created on 12 Apr 2017  Â·  39Comments  Â·  Source: react-native-google-signin/google-signin

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.

Most helpful comment

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

All 39 comments

'WRONG SIGNIN', { [GoogleSigninError: DEVELOPER_ERROR] name: 'GoogleSigninError', code: 10 }

This is the error message when I log in Android.

it's same for my problem

Same problem

Did anyone figure this out?

same thing for me. my project is connected to firebase. maybe this is causing problems?
cc @Kerumen - could you please help us?

same here. I'm bounding with :
"compile 'com.google.android.gms:play-services-auth:10.2.6' ".
After login in Android, I go the message:
{ [GoogleSigninError: DEVELOPER_ERROR] name: 'GoogleSigninError', code: 10 }

Same here guys

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

same

same

@D1no thanks that did it !

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

@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 generated debug keystore and generate sha1 but still the same problem.

'WRONG SIGNIN', { [GoogleSigninError: NETWORK_ERROR] name: 'GoogleSigninError', code: 7 }

-generate debug keystore
keytool -genkey -v -keystore C:Usersbbeckdebug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000

-generating sha1 key
keytool -exportcert -alias androiddebugkey -keystore C:Usersbbeckdebug.keystore -list -v

PS I've also kept the generated Sha1 in google project

What else can cause this problem? I cannot figure it out.

@RileyDavidson-Evans What are the pre-requisites for creating a sign-in in any application? Say a Google account that must be linked to Google Play as a developer?

I followed all the steps as mentioned in your post and still face the same issue,0
WRONG SIGNIN Error: DEVELOPER_ERROR at new GoogleSigninError.............

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

Same here sha1 for release is not matching some how!

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

@D1no , that was it for me as well! I had just moved to a new laptop with a fresh install of the Android SDK, and hence a new debug.keystore. I just brought over my old debug.keystore from my backup. Thanks!

@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.

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.

It’s not necessary if you meant “pay the annual subscription”.

Maybe post here exactly all the steps you’ve done so we can double check with you that everything is correctly in place.

Be specific will help :)

I found it!! just look for your another firebase project (other google account) used same package name, and same SHA1.
just look this link

https://groups.google.com/forum/#!topic/firebase-talk/C4iN9gPQ4Lo

"I was also facing the same issue. Then I searched all my projects on google Apis console and found out that I was using the same SHA1 with the same package name in a different google apis project. That was a mistake in the past I made and I should've used all the google apis in one common project for my android app. So I'll suggest you to check all your apis projects for that specific SHA1 and package name combination.

Thanks for posting this. I was facing the same problem and this post made me realise what I was doing wrong. Hope this helps."

if you delete project or sha1, this is not working immediately.
it must wait for a while

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

We've just merged an improved example app to master which should work given that you've correct configuration.

You need to create google-services.json and Google-Services.plist files in Firebase console for your project. You have to create new project if you don't have one yet. You don't need to include any Firebase libraries for iOS and Android if you're not planning to use them. More detailed instructions can be found here: https://github.com/react-native-community/react-native-google-signin/blob/master/get-config-file.md

I'll close this issue for now. If you are having problems with the new example app don't hesitate to create a new issue. :)

oh god be careful for add certificate fingerprints SHA, add 2 version certificate apk release and debug, because android have different certificate between release and debug.

change SHA1 from debug to release by cmd:
keytool -exportcert -keystore path-to-debug-or-production-keystore -list -v

make sure that the webcClientId's type is "web" rather than "android".

1. Create a firebase project
2. Create a android app with SH-1 key (
       1. Go to Android studio click on gradle by your top right
       2. click on App
       3. click on Android
       4. click on signingReport 
       5. Copy SHA1 key and use it to create the firebase android app
3. Go to the authentication part of your firebase app (Left side menu)
     1. Click on sign in method
     2. Web SDK configuration under Google and copy the key paste it in your Web Client ID config
4. Head back to android firebase app and download `google-service.json`
     1. it should contain the SH1 just added as `certificate_hash`

This is debug

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

Finally, I have fixed this issue (without firebase)
Solution:
1.For Android app also you need to give webclient id. dont use client id of your android application
in the clientid field of your configuration

  1. while creating your client id for web. need to add uri, if you are in development mode need to add local host uri also

http://localhost/

If someone fixed this issue, post that way please.

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

really helpfull thanks, i actually configured wrong things, on seeing your video i realized my mistake

I'm facing this problem since 2 days. I follow every solution but it failed.

Can't seem to solve this issue. I have two custom keystores setup.
What I did:

  1. Exported the SHA-1 with keytool -exportcert -alias KEYSTORE_ALIAS -keystore KEYSTORE_PATH and inserted this to my dev and prod app in Firebase
  2. Also on https://console.developers.google.com/ I have two OAuth 2.0-client-ID's with the correct package names and SHA-1 fingerprints
  3. Copied the webClientId from Firebase Console > Authentication > GoogleSignIn and added it before the signin with Google.Configure
  4. My Android build buildTypes are as following:
    buildTypes {
        debug {
            debuggable true
            productFlavors.dev.signingConfig signingConfigs.dev
            productFlavors.prod.signingConfig signingConfigs.prod
        }
        release {
            debuggable false
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            proguardFiles fileTree(dir: "${project.rootDir}/proguard_libs", include: ["*.pro"]).asList().toArray()
            productFlavors.dev.signingConfig signingConfigs.dev
            productFlavors.prod.signingConfig signingConfigs.prod
        }
    }
  1. Downloaded my latest google-services.json
  2. Ran ./gradlew clean and adb uninstall com.packagename
  3. npm run android

Still the same DEVELOPER_ERROR.
I'm really out of options.. Anyone suggestions?

I was facing the same issue since last three days and getting the error of the DEVELOPER_ERROR.
Today I made some changes in my client auth0 project and it got working.
Some steps I used.

  1. Regenerated new project and Auth0 Client on the console for android
  2. Found my sha1 right from jdk/bin (as of above answers) and paste it to the android required SHA1 Field.
  3. Replaced WebClientId to ClientId in my Google Configure function.
  4. disabled offline access(to prevent NETWORK_ERROR).
    now its working fine.

But as I am working with a web development team and I am myself working on an app, they are using OAuth2 at their backend and website so that means I will also have to use the google_service file which they have generated and they will also provide me webclientId?

make sure that the webcClientId's type is "web" rather than "android".

Yes top make sur it's "client_type": 3

Was this page helpful?
0 / 5 - 0 ratings