Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A non-recoverable sign in failure occurred code 12500 #543

Closed
cafeasia3 opened this issue Oct 10, 2018 · 67 comments
Closed

A non-recoverable sign in failure occurred code 12500 #543

cafeasia3 opened this issue Oct 10, 2018 · 67 comments

Comments

@cafeasia3
Copy link

cafeasia3 commented Oct 10, 2018

I am using

  • react-native 0.55.4 and 0.57.2
  • react-native-google-signin@1.0.0rc1 and react-native-google-signin@1.0.0rc6
  • classpath 'com.android.tools.build:gradle:3.1.4'
    classpath 'com.google.gms:google-services:3.2.1'
  • play-services-auth 16.0.1 & 9.2.1 (tried both version)

I got this error when signIn

{ [Error: A non-recoverable sign in failure occurred] framesToPop: 1,
code: '12500', line: 21326, column: 31, sourceURL: 'http://localhost:8081/index.delta?platform=android&dev=true&minify=false' }

I tried add and remove SHA1 then redownload google-service.json for both setting, still same error.

I tried client ID for web application and android client, both getting same error.

This is my google sign in code

GoogleSignin.configure({
          webClientId: 'xxxxxxx.apps.googleusercontent.com', offlineAccess: true,
        })
  GoogleSignin.hasPlayServices()
  .then(() => {

      GoogleSignin.signIn()
      .then((user) => {
        console.log(user);

      })
      .catch((err) => {
        if(err.code === 'CANCELED')
        {
          console.log('glogin canceled', err.code);
          dispatch(loginFailure(null))
        }
        else{
          console.log('error', err);
        }
      });
  }).catch(err => {
    console.log('Play services error', err.code, err.message);
  });

any idea what cause the error?

@matboud
Copy link

matboud commented Oct 10, 2018

Facing the same issue here !! :/

@cafeasia3
Copy link
Author

cafeasia3 commented Oct 11, 2018

related: https://github.com/react-native-community/react-native-google-signin/issues?q=is%3Aissue+12500+is%3Aclosed

I used this http://developerextensions.com/index.php/help/230-Google-signin-returns-12500,-12501-error-code- to solve it.

I used wrong debug.keystore.

@sonlexqt
Copy link

Hi @cafeasia3 what's the URL that you referenced ? Currently it's pointing to https://github.com/react-native-community/react-native-google-signin/issues/url

@donnycrash
Copy link

Experiencing this issue too

@YazeedAsaad
Copy link

Anyone found a solution ? im getting this same error when i generate a release build , debug works just fine

@ghost
Copy link

ghost commented Oct 23, 2018

@YazeedAsaad release need another sha1 you can find it console.play.store

@HadrienPierart
Copy link

I got stuck on this one for several days until I figured how what was wrong.
I relay with most of the situation described above :

  • Works fine in debug/local
  • If I build the release package and install it through adb install it works fine
  • If I check the SHA1 of the package/keystore, everything is in order and matches the config in Firebase and the google-services.json
  • And then, once deployed in beta or released on the store : the google signin fails miserably...

And I noticed that in the App signing part of the Google Play account :
screenshot from 2018-10-26 12-18-57

I checked the play account (important thing to mention at this point : I did not configure the play account) : And sure enough, my package was being RE-SIGNED by google play certificate...

When you go to the Release Management > App Signing, you will see the SHA1 of the keystore being used by Google after yours. Pick it, paste it in Firebase, update your google-services.json file, redeploy and VOILA !

I really hope this help others to avoid all the hair pulling I've been doing these last few days :D

@never00miss
Copy link

never00miss commented Nov 3, 2018

I am using

  • "react-native": "0.52.0",
  • "react-native-google-signin": "^0.12.0",
  • classpath 'com.android.tools.build:gradle:2.1.2'
  • classpath 'com.google.gms:google-services:3.0.0'

i am still unable to login with google

this is my code

_handleLogin = async () => { 
    await GoogleSignin.configure();
    await GoogleSignin.hasPlayServices({ autoResolve: true });
    GoogleSignin.signIn()
      .then(user => {
        console.log(user);
        const credential = firebase.auth.GoogleAuthProvider.credential(
          user.idToken,
          user.accessToken
        );
        temp_response = {
          id: user.id,
          email: user.email,
          gender: user.gender ? user.gender : "male",
          name: user.name,
          birthday: user.birthday ? user.birthday : "7/16/1987",
          picture_url: user.photo,
          login_type: "google"
        };
        frAuth(credential).then(async () => {
          await setUserLoginType("google");
          await setUserToken(user.accessToken);
          await registerAPI(temp_response);
          await setUserDataStorage(temp_response);
          await initFCMToken();

          // trigger to get all user data from updated asyncstorage and set to redux
          await this.props.rdRefreshUserData();

          this.props.globalLoading(false);
          this.props.navigation.navigate("Main");
        });
      })
      .catch(err => {
        console.log("WRONG SIGNIN", err);
      })
      .done();
  };

and then this is da error
WRONG SIGNIN Error: A non-recoverable sign in failure occurred at new GoogleSigninError (GoogleSignin.android.js:55) at GoogleSignin.android.js:131 at RCTDeviceEventEmitter.emit (EventEmitter.js:181) at MessageQueue.__callFunction (MessageQueue.js:353) at MessageQueue.js:118 at MessageQueue.__guardSafe (MessageQueue.js:316) at MessageQueue.callFunctionReturnFlushedQueue (MessageQueue.js:117) at t (RNDebuggerWorker.js:1)

what i was doing

  1. remove all SHA1 fingerprint on firebase and create new keystore and add again on Setting > project setting (not work)
  2. add configure options = { webClientId: , offlineAccess: true} (not work)

this is run on debug mode, i am still develop so dont testing on release yet.

@AndreiCalazans
Copy link
Collaborator

Please see http://developerextensions.com/help/230-Google-signin-returns-12500,-12501-error-code-

@never00miss
Copy link

never00miss commented Nov 3, 2018

Please see http://developerextensions.com/help/230-Google-signin-returns-12500,-12501-error-code-

i was doin that on point 1, so i was add my keystore SHA1 fingerprint to > firebase, and generate new google-services.json

and the params
google-services.json

{
         "client_id": "<id>.apps.googleusercontent.com",
         "client_type": 1,
         "android_info": {
           "package_name": "com.<name>",
           "certificate_hash": "<hash>"
         }
       },

so this is my gradle.properties

android.useDeprecatedNdk=true
MYAPP_RELEASE_STORE_FILE=my-release-key.keystore
MYAPP_RELEASE_KEY_ALIAS=my-key-alias
MYAPP_RELEASE_STORE_PASSWORD=****
MYAPP_RELEASE_KEY_PASSWORD=****

and path to my keystore ./android/app/my-release-key.keystore

3 or 5 month ago this problem not show, idk why this bug showed this month

@AndreiCalazans
Copy link
Collaborator

I can be wrong, but I think you are missing the webClientId which is required for Android @never00miss

see https://github.com/react-native-community/react-native-google-signin/blob/master/example/index.js#L23

https://github.com/react-native-community/react-native-google-signin/blob/master/android/src/main/java/co/apptailor/googlesignin/RNGoogleSigninModule.java#L111

@never00miss
Copy link

Nope, I was doing that too on point 2.

@jeetAdhikary
Copy link

whoever is using debug.keystore and did all config but still not working check your SHA1 signature whether you are using correct signature .
I have faced in windows .
in official document keystore is located in %USERPROFILE%.android\debug.keystore location .
but my app is not using that keystore is it using different which is located at : %USERPROFILE%\AppData\Local\Android\Sdk.android\debug.keystore .
better take SHA1 signature from Android studio. (this Link may help : https://aboutreact.com/getting-sha1-fingerprint-for-google-api-console/).

hope that helps

@HenryHengZJ
Copy link

any updates? Still facing same issue

@kalraneeraj24550
Copy link

i am facing the same issue, even in debug/local.
error= Error: A non-recoverable sign in failure occurred
error code = 12500

i have checked certificate_hash in googleServices.json is same as hash in firebaseconsole.
application id is also same. plz help me

@cjjabc7
Copy link

cjjabc7 commented Dec 25, 2018

I found a related solution, you must add the SHA-1 certificate fingerprint from App Signing Certificate to Firebase fingerprints.

image

image

That's all, the Google SignIn authentication is done without an error 12500!

@kalraneeraj24550
Copy link

kalraneeraj24550 commented Dec 26, 2018 via email

@kalraneeraj24550
Copy link

kalraneeraj24550 commented Dec 26, 2018 via email

@ghost
Copy link

ghost commented Dec 26, 2018

@kalraneeraj24550 if you have uploaded your app on play store you can get this sha-1 keys as @cjjabc7 has done otherwise you have to add to firebase sha-1 keys. write in terminal "keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android". second one is working only debug mode

@kalraneeraj24550
Copy link

i haven't uploaded the project on the play store. and i have already added SHA1 in firebase project.

@kalraneeraj24550
Copy link

i am getting this error in debug mode. i have deleted current sha-1 present in firebase. then i regenerate certificate key and updated googleservices.json. still facing the error. i dont know where am lacking.
Anyone please help me..

@kalraneeraj24550
Copy link

i have solved it by having sha-1 from android studio not by command line

@pradeepchaudhari91
Copy link

I am facing the same issue, even in debug/local.
Error: A non-recoverable sign-in failure occurred 12500

@kalraneeraj24550
Copy link

i did two steps to solve this error.

  1. i get sha-1 from android studio and paste it on firebase console and redownloaded google-services.json.
  2. i configured it by android client id instead of web client id. this worked for me.

@ajitsen
Copy link

ajitsen commented Jan 18, 2019

My issue was a wrong webClientId in react native code.

I solved by referring http://developerextensions.com/help/230-Google-signin-returns-12500,-12501-error-code-

Copied Client ID of Web Client under OAuth 2.0 client IDs
https://console.developers.google.com/apis/credentials

My Configure now looks like

GoogleSignin.configure({
          webClientId: '888888888888-0eeee74ee19ee6eeeeeeeeeeeheekefe.apps.googleusercontent.com', 
          offlineAccess: true
})

@hiteshagja
Copy link

Re-created app - Still does not work.
Added support email - Worked. Strange but true. Google firebase should give proper error message for this. It wastes lot of developer hours.

@AhadKhwaja
Copy link

I found a FIX, you just have to add SUPPORT EMAIL in firebase console.

It took me a whole day but finally found solution, hope it helps you all too.

@ruijiang
Copy link

I found a FIX, you just have to add SUPPORT EMAIL in firebase console.

It took me a whole day but finally found solution, hope it helps you all too.

You are the hero! I tried so hard and eventually your solution worked. Thanks man!

@fontesrp
Copy link

I found a FIX, you just have to add SUPPORT EMAIL in firebase console.

It took me a whole day but finally found solution, hope it helps you all too.

You just saved me a lot of hours of pointless debugging. Thanks!

@mhmdAljefri
Copy link

I faced the Same Issue but, and the reason for it in my application was because I forgot to add googlePlayServicesAuthVersion in build.gardle.

@SaranyaArumugam
Copy link

SaranyaArumugam commented Jul 15, 2019

I am getting this type of Error Code -- 12500. but I have added support url in firebase console. I did not get any response.

@IbrahimCanKALYA
Copy link

@SaranyaArumugam i did everything bu still same problem did u find solution if u find share it ?

thanks in advance

@Suhas404
Copy link

@SaranyaArumugam
config your Web SDK configuration then go to https://console.developers.google.com/
config OAuth Consent Screen
Update all your privacy policy

@Choomantar
Copy link

Choomantar commented Aug 1, 2019

I am also getting the same error 12500, done everything u guys told in above discussion but the result is same, help me
the app is in debug mode, I think something is wrong with OAuth Consent Screen

@MuhammadUmar00
Copy link

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

@Choomantar
Copy link

adding privacy policy in OAuth resolved my problem

@arsalan-arshad
Copy link

Just verify google credentials in OAuth consent screen at console.developers.google.com and save your time

@qwertzguy
Copy link

qwertzguy commented Sep 12, 2019

Solved it by simply redownloading the google-services.json file from firebase console > Project Settings > General > scroll to Your Apps > select android app > Download google-service.json.
I had updating my hash in firebase console but had not re-downloaded the json file. Redownloding and replacing it in the app resource.
THEN: enabling Google auth in Firebase, which triggers the prompt to set a public name for the app (which I think it what was the real issue for Google sign in).

@Qamarkh
Copy link

Qamarkh commented Jan 10, 2020

Hello All, almost all solutions I have tried to resolve this problem the but unfortunately did not get any success. Finally I have deleted my
1 . Firebase registed App
2. Firebase project
3.google developer console projects
And after that created new Firebase project/registered App
Now its started working.

@elirant3
Copy link

As hard as it may be to believe, the fix was filling out the "Support email" field in Firebase!

Exact steps I took to fix 12500 error code:

  1. Enable Google as a Sign-In Provider under Firebase > Authentication (not sure if necessary but I did it anyways)
  2. Fill out the Support email field under Firebase > Project Settings (this is necessary and fixed my issue)

It appears to be related to the OAuth consent; more details in this StackOverflow. Hope this helps!

i love you! days.....

@hayderespit
Copy link

https://developers.google.com/identity/sign-in/android/start-integrating

You have to click on configure a project then take the web client id that this process generated

@dakkafex
Copy link

Sign in suddenly stopped working for me and im getting A non-recoverable sign in failure occurred is there anyway i can debug this, because that error message is pretty useless, and i cant catch the error either it seems

@davincho
Copy link

davincho commented Dec 8, 2020

@dakkafex I had the same error like you, I followed @Choomantar comment and my problem got solved.

@jatin-codes
Copy link

jatin-codes commented Dec 13, 2020

:( Still facing the issue where I have

  • A valid email address provided both in firebase and google OAuth consent screen.
  • Google authentication is enabled under firebase

@Nikita-Filonov
Copy link

I go throug all this solutions but none of them works for me. What really helped:

  scopes: ['https://www.googleapis.com/auth/drive.readonly'],  // <--- delete this line from your GoogleSignin.configure
  webClientId: '<FROM DEVELOPER CONSOLE>',
  offlineAccess: true, 

Of course you should try all solutions above. But I just leave it here

@abdallaemadeldin
Copy link

i have the same issue but i don't use firebase any solutions?

@DheerajGadwala
Copy link

DheerajGadwala commented Jul 24, 2021

Creating a new debug.keystore and SHA1 then updating it on firebase worked for me.

@Qamarkh
Copy link

Qamarkh commented Jul 25, 2021 via email

@RodrigoSarmento
Copy link

I go throug all this solutions but none of them works for me. What really helped:

  scopes: ['https://www.googleapis.com/auth/drive.readonly'],  // <--- delete this line from your GoogleSignin.configure
  webClientId: '<FROM DEVELOPER CONSOLE>',
  offlineAccess: true, 

Of course you should try all solutions above. But I just leave it here

I have no idea why but this works for me.

@Devendra0110
Copy link

As hard as it may be to believe, the fix was filling out the "Support email" field in Firebase!

Exact steps I took to fix 12500 error code:

  1. Enable Google as a Sign-In Provider under Firebase > Authentication (not sure if necessary but I did it anyways)
  2. Fill out the Support email field under Firebase > Project Settings (this is necessary and fixed my issue)

It appears to be related to the OAuth consent; more details in this StackOverflow. Hope this helps!

Still don't get how support email can cause an issue. And Yeah it did work.

@Akifcan
Copy link

Akifcan commented Aug 8, 2023

Make sure set publishing status to production in OAuth consent screen

@qrobin
Copy link

qrobin commented Sep 10, 2023

One more thing, guys: make sure you use 'https://' in scope names:

const scopes = [
  'email',
  'profile',
  'openid',
  'https://www.googleapis.com/auth/calendar.events',
  'https://www.googleapis.com/auth/calendar'
];

I initially used them like this:

const scopes = [
  'email',
  'profile',
  'openid',
  'www.googleapis.com/auth/calendar.events',
  'www.googleapis.com/auth/calendar'
];

It took me two days to figure out what was wrong [crying]. At least now I know google oauth2 integration into android app pretty well.

@johnsonfash
Copy link

johnsonfash commented Nov 3, 2023

I faced this same issue for over a day.

This is whats causing the problem
If you Open your android studio and open project, goto your expo/react native "android" folder and click the project,
After build,

  1. On the right hand side you will see gradle, along with other options, its a vertical bar with the gradle button text rotated 90deg. Click it, a tab on the right shows, you will see a little mouse image along with other options, click it and a tab will show afterwards.
  2. the tab shows gradle and an input to type something, type in: signingreport
  3. click enter, and you will see the SHA-1 fingerprint, just copy the first one when you scroll up,
  4. Goto google console and use that SHA-1 to create your android credentials, copy the android client id given,
  5. Goto android/app/src/main/res/values/string.xml
  6. Paste this in the list: YOUR_GOOGLE_ANDROID_CLIENT_ID
  7. In your eas.json, make sure credentialSource is pointing to local, here is a sample

{ "cli": { "version": ">= 5.4.0" }, "build": { "development": { "android": { "buildType": "apk", "credentialsSource": "local" }, "developmentClient": true, "distribution": "internal" }, "preview": { "android": { "buildType": "apk", "credentialsSource": "local" }, "distribution": "internal" }, "production": { "android": { "buildType": "apk", "credentialsSource": "local" } } }, "submit": { "production": {} } }

  1. Create credentials.json file and add this

{ "android": { "keystore": { "keystorePath": "./android/app/debug.keystore", "keystorePassword": "android", "keyAlias": "androiddebugkey", "keyPassword": "android" } }, }

Then run one of the profile from eas.json

The issue you are facing is that expo uses debug.keystore to sign your app, as you would have see in the android studio signingreport. To use a release.keystore or any other, Variant: release from signingreport and other package seen in that report need to be configured to use the release.keystore. You can do a google search on how to do that.

@Ankush-Hegde
Copy link

even i am getting same issue....
I am trying to implement the google oAuth login in my react-native android app without firebase.

I have gone through this article

THIS IS MY CODE

import {View, Text} from 'react-native';
import React, {useEffect} from 'react';
import {
  GoogleSignin,
  GoogleSigninButton,
  statusCodes,
} from '@react-native-google-signin/google-signin';

const App = () => {
  useEffect(() => {
    GoogleSignin.configure({
      webClientId:
        'xxxxxxxxxxxx-xxxxxxxxxxxxx45xxxxxxx0xxx4xxx.apps.googleusercontent.com',
      offlineAccess: true,
      forceCodeForRefreshToken: true,
    });
  });

  const signIn = async () => {
    try {
      await GoogleSignin.hasPlayServices();
      const userInfo = await GoogleSignin.signIn();

      console.log(userInfo);
    } catch (error: any) {
      if (error.code === statusCodes.SIGN_IN_CANCELLED) {
        console.log('User cancelled the login flow');
      } else if (error.code === statusCodes.IN_PROGRESS) {
        console.log('Signing in');
      } else if (error.code === statusCodes.PLAY_SERVICES_NOT_AVAILABLE) {
        console.log('Play services not available');
      } else {
        console.log('Some other error happened');
        console.log(error.message);
        console.log(error.code);
        console.log(error);
      }
    }
  };

  return (
    <View>
      <Text>App</Text>
      <GoogleSigninButton
        size={GoogleSigninButton.Size.Wide}
        color={GoogleSigninButton.Color.Dark}
        onPress={signIn}
      />
    </View>
  );
};

export default App;

when i searched for this error. I came to know that we need to use firebase to solve this.
then i came across this article

where i got to know about this from that article

Walkthrough for different modes:

Development Firebase

  • run cd android && ./gradlew signingReport.
  • Copy the SHA-1 hash and paste it into the firebase console under Android in Project Settings.
  • Download the google-services.json file from the Firebase settings and paste the file into android/app
  • Use the client client_type: 3 clientId inside the config.

Development non-Firebase

  • run cd android && ./gradlew signingReport.
  • Copy the SHA-1 hash
  • Go to Google Cloud Platform Console and click Create Credentials -> * OAuthClientID. Choose type Android and paste the hash and fill in the form
  • Create another Client by clicking Create Credentials, but choose type Web application this time.
  • Use the webclient in your code

Production/Release version

  • Go to the Google Play console and copy SHA-1 key from Release -> Setup -> App Integrity
  • Go to Google Cloud Platform Console and click Create Credentials -> * OAuthClientID. Choose type Android and paste the hash and fill in the form
  • Create another Client by clicking Create Credentials, but choose type Web application this time.
  • Use the webclient in your code

i have tryed to implement using this method Development non-Firebase but still facing the same error

this is my error logs after selecting the google account to login

Some other error happened
LOG A non-recoverable sign in failure occurred
LOG 12500
LOG [Error: A non-recoverable sign in failure occurred]

and i get this when i run ./gradlew signingReport command

Task :app:signingReport
Variant: debug
Config: debug
Store: C:\Users\username\Desktop\oAuth-google-react-native\AwesomeProject\android\app\debug.keystore
Alias: androiddebugkey
MD5: xxx::xx::xxxx::xxxxx::xxxxxxxxxxxxx::xxxxxxx::xxxxxxx
SHA1: xxx::xx::xxxx::xxxxx::xxxxxxxxxxxxx::xxxxxxx::xxxxxxx
SHA-256: xxx::xx::xxxx::xxxxx::xxxxxxxxxxxxx::xxxxxxx::xxxxxxx
Valid until: Wednesday, May 1, 2052

Variant: release
Config: debug
Store: C:\Users\username\Desktop\oAuth-google-react-native\AwesomeProject\android\app\debug.keystore
Alias: androiddebugkey
MD5: xxx::xx::xxxx::xxxxx::xxxxxxxxxxxxx::xxxxxxx::xxxxxxx
SHA1: xxx::xx::xxxx::xxxxx::xxxxxxxxxxxxx::xxxxxxx::xxxxxxx
SHA-256: xxx::xx::xxxx::xxxxx::xxxxxxxxxxxxx::xxxxxxx::xxxxxxx
Valid until: Wednesday, May 1, 2052

Variant: debugAndroidTest
Config: debug
Store: C:\Users\username\Desktop\oAuth-google-react-native\AwesomeProject\android\app\debug.keystore
Alias: androiddebugkey
MD5: xxx::xx::xxxx::xxxxx::xxxxxxxxxxxxx::xxxxxxx::xxxxxxx
SHA1: xxx::xx::xxxx::xxxxx::xxxxxxxxxxxxx::xxxxxxx::xxxxxxx
SHA-256: xxx::xx::xxxx::xxxxx::xxxxxxxxxxxxx::xxxxxxx::xxxxxxx
Valid until: Wednesday, May 1, 2052

Task :react-native-google-signin_google-signin:signingReport
Variant: debugAndroidTest
Config: debug
Store: C:\Users\username.android\debug.keystore
Alias: AndroidDebugKey
Error: Missing keystore

BUILD SUCCESSFUL in 8s
7 actionable tasks: 2 executed, 5 up-to-date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests