google-signin: Android - Updated to RN 61 now getting DEVELOPER ERROR
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
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 3
- Comments: 57 (3 by maintainers)
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 androidNow 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 androidAlso I didn’t change any configuration and use webClientId from console.cloud => apis => credentials.
GoogleSignin.configure({ webClientId: GOOGLE_WEB_CLIENT_ID, })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 -vfor your SHA1 value in the Android key. The package name is in android/app/build.gradleandroid.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.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 monkibraumI changed
webClientIdfound in the firebase console under Google authentication, and addofflineAccess: truenow its 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.
My solution separate iOS and android platform.
@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:
I am pretty sure I get this error because something is wrong in the setup, but I tried everything from the docs.
@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.
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.
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.
I am having the exact same issue, doesn’t work on device or emulator. Working great on iOS!
I have tried all of the above and am still pulling the DEVELOPER_ERROR. Is there a description anywhere of what this actually means?
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.
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?
Please do not call the configure function with any param as
google-services.jsonincludes 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-signinBe 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
No matters weather you are using a firebase or NOT you have to have both the configurations (Android as well as Web client )

//DeveloperError or any login error https://developers.google.com/identity/sign-in/android/start-integrating#next_steps
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.
@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.
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.
@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:
webClientIdin your javascript code which is supplied with your api credentialsAny 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.
@klaaz0r did you find out the issue ? what’s problem for setup ? I am getting the same errors.
I was trying keytool -exportcert -keystore ~/.android/debug.keystore -list -v which of course was giving me a SHA1 key but it was not working, after searching for a while I also look closer into my project/android/app folder and found that there is a debug.keystore key too (whose default password is android, in case some need to know ) so I tried cd android and keytool -exportcert -keystore app/debug.keystore -list -v command and the key I got, worked really well. I hope it will help.
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.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.
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.
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.keystoreand replaced withRNProject/android/app/debug.keystore. This solved the developer error for me.@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: truerequired?@krewllobster awesome, attach fingerprint to firebase console, replace new google service json file and
await GoogleSignin.configure({ webClientId:"xxxxxxxx", offlineAccess: true });then it works.