Google-signin: Android - Updated to RN 61 now getting DEVELOPER ERROR

Created on 27 Feb 2020  路  55Comments  路  Source: react-native-google-signin/google-signin

Hi, I updated my RN and now google sign-in is not working and returning the delightfully opaque DEVELOPER ERROR.

It works fine on iOS and nothing has changed in my code or setup.

This is my login code:

    async function googleLogin({ cancel, success }) {
        try {
            GoogleSignin.configure({
                webClientId: MY_WEB_CLIENT_ID,
            });
            const data = await GoogleSignin.signIn();
            const credential = firebase.auth.GoogleAuthProvider.credential(data.idToken, data.accessToken);
            const firebaseUserCredential = await auth().signInWithCredential(credential);
            if (firebaseUserCredential) setLoggedInGoogle(true);
            if (typeof success === 'function') success();
        } catch (e) {
            console.warn('GOOGLE ERROR', e);
            if (typeof cancel == 'function') cancel();
        }
    }

the full returned error:

YellowBox.js:71 GOOGLE ERROR Error: DEVELOPER_ERROR
    at Object.fn [as signIn] (NativeModules.js:99)
    at GoogleSignin.signIn$ (GoogleSignin.js:20)
    at tryCatch (runtime.js:45)
    at Generator.invoke [as _invoke] (runtime.js:271)
    at Generator.prototype.<computed> [as next] (runtime.js:97)
    at tryCatch (runtime.js:45)
    at invoke (runtime.js:135)
    at runtime.js:145
    at tryCallOne (core.js:37)
    at core.js:123

Most helpful comment

First, you have to be aware that in this issue, we're talking about error when updating RN to 0.61 (or using RN 0.61 or above perhaps). As @vonovak mentioned, there was a new debug.keystore https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.5.

In my case, previously I used RN v0.59.10 with react-native-google-signin v2.0.0. I generated keystore using this reference
https://stackoverflow.com/questions/15727912/sha-1-fingerprint-of-keystore-certificate
which used ~/.android/debug.keystore as the debug.keystore path.
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

Now I use RN 0.61.5 with react-native-community/google-signin v4.0.0. I solved it with new fingerprint, using new debug.keystore in android/app/debug.keystore, register the SHA to firebase console, download new google-services.json and replace old one.
keytool -list -v -keystore ./android/app/debug.keystore -alias androiddebugkey -storepass android -keypass android

Also I didn't change any configuration and use webClientId from console.cloud => apis => credentials.
GoogleSignin.configure({ webClientId: GOOGLE_WEB_CLIENT_ID, })

All 55 comments

I am having the exact same issue, doesn't work on device or emulator. Working great on iOS!

hello, there was a new keystore file added, see https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.5

maybe that is the cause. If this does not help, please add a runnable repro, otherwise this is not actionable. Thanks!

@vonovak Maybe you can clarify this a little because the docs + issues I read seem to contradict sometimes.

So I am not using firebase so I use credentials directly. From what I can read in the docs:

  • Use the webClientId not the androidId, so I don't need to use my SHA1? it's not needed for setting up OAuth credentials.
  • Setup everything correctly and point to the right keystore (release and debug!). For release the play store generates signing keys, I need that SHA1? But I don't need the SHA1 at all since I am using OAuth credentials right?
  • Do I need to set the webClientId in the config? or should I skip it because I am using the keystore file?

I am pretty sure I get this error because something is wrong in the setup, but I tried everything from the docs.

Maybe you can clarify this a little because the docs + issues I read seem to contradict sometimes.
So I am not using firebase so I use credentials directly.

hello and thanks for the comment; I personally use firebase and so I don't have hands-on experience with other ways of consuming the library. Please, if you see there is any kind of problem with the docs, be so kind and contribute a PR, it'll be greatly appreciated, thank you!

@klaaz0r did you find out the issue ? what's problem for setup ? I am getting the same errors.

I just inherited a code base built with react-native 0.61.4 and clean installed @react-native-community/google-signin today. I too am receiving a wonderfully opaque "DEVELOPER_ERROR" and I have followed the steps in the FAQ to make sure that I have the appropriate SHA-1 fingerprint in my firebase project settings. I am configuring google-signin with the webClientId found in the firebase console under Google authentication.

@krewllobster awesome, attach fingerprint to firebase console, replace new google service json file and
await GoogleSignin.configure({ webClientId:"xxxxxxxx", offlineAccess: true });
then it works.

@pasha-it I switched to firebase because I was using push notifications anyway. All you need todo is add all the finger prints (including debug, if you use that) and I should work. Is offlineAccess: true required?

@klaaz0r I am not sure.

I changed webClientId found in the firebase console under Google authentication, and add offlineAccess: true now its works!

I have tried all of the above and am still pulling the DEVELOPER_ERROR. Is there a description anywhere of what this actually means?

@krewllobster not in any detailed satisfying way; but in general it means that you aren't authenticating with the service properly; which can be a variety of things:

1) using the proper webClientId in your javascript code which is supplied with your api credentials
2) making sure your api credentials included in your native code are up to date (google-services.json or whatever)
3) making sure you have the correct debug&release key finger prints included in the firebase or google services console.

Any of these things not being correct can lead to "DEVELOPER ERROR"

In my case, I needed to download and include an updated version of my google-services.json AFTER adding the new debug key finger print to the firebase console.

@allthetime thanks for responding! Is it possible for an old fingerprint (from a different dev in a former time) could be conflicting? I think there are three SHA-1 fingerprints in the firebase console. I added 2, one is my debug SHA-1 (found via instructions in Android walkthrough) and the other is my release key. I know it works with my release key (finally!) but it still seems to not work in debug. Should I delete the old SHA-1 and re-download google-services.json?

Edit: Turns out that I had not explored the signing report quite enough and there was one more SHA-1 hash being used in debug mode that hadn't been added to the firebase project settings. If you're reading this thread because you're having this issue, double check to see if you are using any custom keys. It turns out that my app was using a custom debug key that was different to the default android debug key as it was stored in the android folder of the project. In the signing report I needed to go all the way back up to the top to see the debug mode SHA-1 hash for the actual app intent, and that's when I realized that there was an extra SHA-1. I am not an android dev, so I had never used the signing report before! Thanks for the input in this thread everyone.

@krewllobster finger prints don't conflict, but they will pollute your credentials making it a little more confusing to figure things like this out! I had the same thing going on with stale fingerprints being represented in my google-services.json.

I'm also having this issue and it used to work before. I've tried creating a new Android app on the same Firebase project, triple checked every SHA-1 key, new debug keystore and new release keystore - Still no luck and getting the annoying DEVELOPER ERROR.

I have been trying to debug this for many hours and finally I resolve it by this:
https://github.com/react-native-community/google-signin/issues/794#issuecomment-566510524

I don't know why the webClientId from firebase does not work but from the Google Console API works. Perhaps someone can shed some light and also update it in the README?

If you have key store file at this location {your_project_root}/android/app/debug.keystore, then use this file for making SHA1 hash for your project. Not the one you have at ~/.android/debug.keystore.
Ref: 794 Comment From monkibraum

I got it to work you just have to add the webClientId from firebase

import {GoogleSignin} from '@react-native-community/google-signin';

await GoogleSignin.configure({
    webClientId: WEB_CLIENT_ID
 });

Looking through the issues and comments again, I think that the issue with webClientId is that if you are using react-native-firebase, then you need to get the webClientId from firebase.

But if you are not using that, you should get the webClientId from Google API console as per https://github.com/react-native-community/google-signin/issues/794#issuecomment-566510524

I am not using react-native-firebase so the webClientId as per the README does not work for me. My webClientId from Google API works.

In my case, I used second method to generate configuration file, it was generated as credentials.json so i renamed it to google-services.json. then i copied the debug.keystore file from C:\Users\username\.android\debug.keystore and replaced with RNProject/android/app/debug.keystore. This solved the developer error for me.

Same DEVELOPER ERROR..

I have the same issue, while Generating the release APK.

My solution separate iOS and android platform.

      if (Platform.OS === 'android') {
        await GoogleSignin.configure({
          forceCodeForRefreshToken: true,
        })
      } else {
        await GoogleSignin.configure({
          webClientId: GOOGLE_CLIENT_ID,
          forceCodeForRefreshToken: true,
          iosClientId: GOOGLE_CLIENT_ID
        })
      }

First, you have to be aware that in this issue, we're talking about error when updating RN to 0.61 (or using RN 0.61 or above perhaps). As @vonovak mentioned, there was a new debug.keystore https://react-native-community.github.io/upgrade-helper/?from=0.60.6&to=0.61.5.

In my case, previously I used RN v0.59.10 with react-native-google-signin v2.0.0. I generated keystore using this reference
https://stackoverflow.com/questions/15727912/sha-1-fingerprint-of-keystore-certificate
which used ~/.android/debug.keystore as the debug.keystore path.
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

Now I use RN 0.61.5 with react-native-community/google-signin v4.0.0. I solved it with new fingerprint, using new debug.keystore in android/app/debug.keystore, register the SHA to firebase console, download new google-services.json and replace old one.
keytool -list -v -keystore ./android/app/debug.keystore -alias androiddebugkey -storepass android -keypass android

Also I didn't change any configuration and use webClientId from console.cloud => apis => credentials.
GoogleSignin.configure({ webClientId: GOOGLE_WEB_CLIENT_ID, })

Be sure to check in the Firebase Console, under "Authentication" -> "Sign-in methods" that Google is enabled, I found it disabled, I didn't even know that there was that option

If anyone is still having issues, I was able to find another source of trouble in this whole process. First, here was our setup:

Everything worked swimmingly with debug builds (we generated SHA1 hashes of our local dev keystore) and everything worked great with release APKs that we were installing directly to device (we generated a SHA1 hash of our production key to get this to work). However, when generating an AAB and uploading to the Beta channel and trying this version, we would get the nefarious DEVELOPER_ERROR.

The fix? I went into the PlayStore console and found a tab named "App Signing" under "Release management" There, I found yet another SHA1 which I then put into our Google Console account. After that, everything worked.

My theory? The PlayStore must be doing something when it creates a thinned app (not sure what it's called in Android land) that requires it to sign with some new certificates, behind the scenes. This SHA1 in the PlayStore console must correspond to these keys and was likely the missing piece.

@staufman This is because you are using .aab to publish your Android app in which the Play store will re-sign your app when pushed to production/testing track. Hence, you are required to use the App Signing SHA1 fingerprint which is the cert of Play store.

Please note that internal testing uses another set of signing by Play store and as such, you need to upload that SHA1 fingerprint as well if you are using the internal testing track of Play store.

Refer to https://github.com/react-native-community/google-signin/blob/master/docs/android-guide.md#faq--troubleshooting for more explanation.

resolved by:-
1. used SHA-1 created from android studio Gradle sign-in report from folder android/app
(Scroll to top up to find this )
2.Added this SHA-1 to fingerprint firebase console
3.Used web client id from firebase > authentication > sign in method > google> web sdk configuration > web client id.
(you can get also from google developer console. Take web client id auto created by Google service under OAuth 2.0 client ids )

react-native : 0.61.5
react-native-google-signin: 2.1.1

Thanks to all those who have commented for this issue.
Happy Coding
ps: ignore the grammar.

I have use google console webClientId, delete project from firebase and re-config it 4 times, check auth/google signin enable, but still getting
Screen Shot 2020-04-05 at 3 07 33 PM

I have both debug and release keystore but using debug keystore only. I fix this bug by including both sha-1 of debug and release in firebase console.

Looking through the issues and comments again, I think that the issue with webClientId is that if you are using react-native-firebase, then you need to get the webClientId from firebase.

But if you are not using that, you should get the webClientId from Google API console as per #794 (comment)

I am not using react-native-firebase so the webClientId as per the README does not work for me. My webClientId from Google API works.

I also followed this answer. Thanks for bringing this up. I initially tried with the client ID obtained from the Google Developer Console but it didnt work. Then I saw that the newly generated google-services.json file (after adding the firebase/auth and the SHA-1 configuration you get an updated .json file) contained a new set of client_id information.

Then I used the client_id in the new google-services.json.
It is there in the google-services.json file. client > oauth_client > client_id with client_type = 3.

Then it worked.

If anyone is still having issues, I was able to find another source of trouble in this whole process. First, here was our setup:

Everything worked swimmingly with debug builds (we generated SHA1 hashes of our local dev keystore) and everything worked great with release APKs that we were installing directly to device (we generated a SHA1 hash of our production key to get this to work). However, when generating an AAB and uploading to the Beta channel and trying this version, we would get the nefarious DEVELOPER_ERROR.

The fix? I went into the PlayStore console and found a tab named "App Signing" under "Release management" There, I found yet another SHA1 which I then put into our Google Console account. After that, everything worked.

My theory? The PlayStore must be doing something when it creates a thinned app (not sure what it's called in Android land) that requires it to sign with some new certificates, behind the scenes. This SHA1 in the PlayStore console must correspond to these keys and was likely the missing piece.

@staufman You saved me lot of trouble.
I am able to update the SHA1 key provided by the google signin key. Any idea how can I get hash for facebook login as well ?

Interesting, I'll definitelly take a loot into it when uploading my next app. Thank you , sir.

Surprisingly the SHA-1 from Android Studio was the issue. However when I got the SHA-1 from android/app/debug.keystore INSTEAD of android/debug.keystore it worked.
In project root directory use: keytool -keystore ./android/app/debug.keystore -list -v and press ENTER when asked for password

I spent 3 hours reading each comment and following the advices but I still got DEVELOPER ERROR.

Then I realized my application package name was different than the package name in the Firebase app.

In my application the package name was:

com.myapp

In my firebase the package name was:

com.mycompany.myapp

So I followed this tutorial to change my app name. Then I searched the whole project for com.myapp to make sure everything was changed. Now it works 馃帀

I have both debug and release keystore but using debug keystore only. I fix this bug by including both sha-1 of debug and release in firebase console.

thank for this one, i have solved this issu by following your 馃挴

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?

No matters weather you are using a firebase or NOT you have to have both the configurations (Android as well as Web client )
Screenshot 2020-09-09 at 5 35 45 PM

//DeveloperError or any login error
https://developers.google.com/identity/sign-in/android/start-integrating#next_steps

Click on Configure a prioject
Select the project.
Fille the required fields.
Voylla, you are good to go.

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.

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

Hello, Have you used with firebase or without firebase ?
I am using it without firebase google signin and trying it for android platform
GoogleSignin.configure ({
webClientId: '*.apps.googleusercontent.com',
})

here ClientId is not supported.

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.

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

had the same issue. It is solved after I noticed that I put the wrong client_id to webClientId.
It should be the one with client_type": 3 in google-services.json not the first one.

For someone facing similar issue, one of the reasons is not having appropriate SHA1 key configured in firebase. At least that's what happened in my case.
To fix this, on project's android root, I hit the command ./gradlew signingReport , which provided all the keystores details. What you are look for in the response is SHA1 keys for debug & release config(only android/app level stores, not library level stores. you'll find them in first couple of records in response). Grab those SHA1 keys, put them in Firebase's android app setting, download & place the updated google-services.json file at android->app.

I think the latest comment of @meetjpatel is the only correct answer. Only way I found the correct SHA hashes. Although I want to add that while the app was live the Google Play Store console supplied different SHA hashes, which can be found under Configuration > App Signing on https://play.google.com/console

Hi, I updated my RN and now google sign-in is not working and returning the delightfully opaque DEVELOPER ERROR.

It works fine on iOS and nothing has changed in my code or setup.

This is my login code:

    async function googleLogin({ cancel, success }) {
        try {
            GoogleSignin.configure({
                webClientId: MY_WEB_CLIENT_ID,
            });
            const data = await GoogleSignin.signIn();
            const credential = firebase.auth.GoogleAuthProvider.credential(data.idToken, data.accessToken);
            const firebaseUserCredential = await auth().signInWithCredential(credential);
            if (firebaseUserCredential) setLoggedInGoogle(true);
            if (typeof success === 'function') success();
        } catch (e) {
            console.warn('GOOGLE ERROR', e);
            if (typeof cancel == 'function') cancel();
        }
    }

the full returned error:

YellowBox.js:71 GOOGLE ERROR Error: DEVELOPER_ERROR
    at Object.fn [as signIn] (NativeModules.js:99)
    at GoogleSignin.signIn$ (GoogleSignin.js:20)
    at tryCatch (runtime.js:45)
    at Generator.invoke [as _invoke] (runtime.js:271)
    at Generator.prototype.<computed> [as next] (runtime.js:97)
    at tryCatch (runtime.js:45)
    at invoke (runtime.js:135)
    at runtime.js:145
    at tryCallOne (core.js:37)
    at core.js:123

Please do not call the configure function with any param as google-services.json includes all the required information(It's included as soon as you create a web client id in cloud console) hence calling it again with the webClientId is creating a configuration conflict hence getting DEVELOPER_ERROR.
Just use:
GoogleSignIn.configure()
It's not documented but it should be, on both https://rnfirebase.io/ and https://www.npmjs.com/package/@react-native-community/google-signin

Ensure that the SHA1 key is added to your project and the entry is there in the google-services,json file.
Change the GoogleSignIn.configure() method parameter as empty

For anybody like me attempting to NOT use firebase, this is how I got it working.

Create TWO OAuth tokens in Google Cloud Console. One web application key, and an Android key. Use the debug.keystore file in android/app/debug.keystore: keytool -keystore android/app/debug.keystore -list -v for your SHA1 value in the Android key. The package name is in android/app/build.gradle android.defaultConfig.applicationId.

The simple existence of this Android key, even though you are not using the actual client ID at all, means it will work. In configure(), use the web application client ID.

here is my workaround for using Google API (no firebase)
we need both key Oauth2, web type for webClientID and android type to registering SHA-1 in google.
the detail here: https://github.com/react-native-google-signin/google-signin/issues/932

For anybody like me attempting to NOT use firebase, this is how I got it working.

Create TWO OAuth tokens in Google Cloud Console. One web application key, and an Android key. Use the debug.keystore file in android/app/debug.keystore: keytool -keystore android/app/debug.keystore -list -v for your SHA1 value in the Android key. The package name is in android/app/build.gradle android.defaultConfig.applicationId.

The simple existence of this Android key, even though you are not using the actual client ID at all, means it will work. In configure(), use the web application client ID.

This works, how or why does it work?
No one knows, but it works.
Thank you!

I have both debug and release keystore but using debug keystore only. I fix this bug by including both sha-1 of debug and release in firebase console.

This worked for me

No matters weather you are using a firebase or NOT you have to have both the configurations (Android as well as Web client )
Screenshot 2020-09-09 at 5 35 45 PM

//DeveloperError or any login error
https://developers.google.com/identity/sign-in/android/start-integrating#next_steps

Click on Configure a prioject
Select the project.
Fille the required fields.
Voylla, you are good to go.

surprisingly it worked for me thanks a lot bro

Spent many hours on this. Preamble: I started working on an app created by another developer. My fix: added my own SHA1 fingerprint found at C:\Users\Admin.android\debug.keystore to google developer console and firebase console of the project, update google-services.json and the developer error is gone.

refer this, https://github.com/react-native-google-signin/google-signin/issues/794#issuecomment-566510524
i spent whole day trying to fix this,
chose the web client(checkout the above mentioned issue, u will understand)

You need to create two applications inside google developer console for your react native app. One of type web application and second with type android.

use ClientID of web application with GoogleSignin.configure

react-native-DEVELOPER_ERROR

To get SHA 1 of your react native app on windows run this on root folder

cd android && gradlew signingReport

I am going to close this because it's not an issue with the library but the way the environment is set up, thank you 馃檪

Was this page helpful?
0 / 5 - 0 ratings