Google-signin: WRONG SIGNIN Error: unknown status code: 12501(…)

Created on 21 Jul 2016  Â·  12Comments  Â·  Source: react-native-google-signin/google-signin

I follow the tutorial.

i have the following code:

componentDidMount() {


         GoogleSignin.hasPlayServices({autoResolve: true}).then(() => {
            // play services are available. can now configure library
            GoogleSignin.configure({
                scopes: [
                    'email', 'profile', 'https://www.googleapis.com/auth/plus.profile.emails.read', 'https://www.googleapis.com/auth/plus.login'
                ],
                webClientId: 'web-clientid from the console developper',
                offlineAccess: true
            }).then(() => {
                // you can now call currentUserAsync()
                GoogleSignin.currentUserAsync().then((user) => {
                    console.log('USER', user);
                }).done();
            });
         });
    }

    signIn() {
        GoogleSignin.signIn()
            .then((user) => {
                console.log(user);
            })
            .catch((err) => {
                console.log('WRONG SIGNIN', err);
            })
            .done();
    }

 render() {
        return (
            <Image source={BACKGROUND} style={styles.container}>
                <Image source={ICON}></Image>
                <Text style={styles.welcome}>
                    APP TEST
                </Text>

                <GoogleSigninButton
                    style={{width: 230, height: 48}}
                    size={GoogleSigninButton.Size.Standard}
                    color={GoogleSigninButton.Color.Light}
                    onPress={this.signIn}
                />
            </Image>
        );

In other issue someone told to download the google-services again. i do that, but the file is equal to the file i previous download.
pretty sure, i'm missing something, but dont no what.
Can anyone helping me?

Thanks in advance

Most helpful comment

I was getting the same error but I fixed re-creating my google-services.json from https://developers.google.com/mobile/add

screenshot

After create the project go to the Google API console, select the project (dropdown next to GoogleAPIs logo) and copy the clientID of your WEB CLIENT

screenshot 1

GoogleSignin.configure({
                scopes: [
                    'email', 'profile', 'https://www.googleapis.com/auth/plus.profile.emails.read', 'https://www.googleapis.com/auth/plus.login'
                ],
                webClientId: 'WEB-CLIENT-ID',
                offlineAccess: true

All 12 comments

hello @jcrjaci

please have a look at the Android guide FAQ.

@devfd i forget to mention that. but i check that to.
i confirm that my certificate_hash in android/app/google-services.json are the same.

Also make sure the application id matches the one you enter on the cloud console.
the aplication id in my app/build.graddle are the same that i enter in the google cloud.

in my scoope, which client id i need to pass?
screen

i already try with the two clients id that are in the oauth 2

Hello @jcrjaci, here are some things you can try :

  1. Make sure all your sdks are updated in Android Studio SDK Manager [!]
  2. For the webClientId property, pass the Client ID from your Web Client.
  3. Sign your app with your debug key ( or key used to generate your certificate ).

Sorry, same issues here. When canceling login.

I was getting the same error but I fixed re-creating my google-services.json from https://developers.google.com/mobile/add

screenshot

After create the project go to the Google API console, select the project (dropdown next to GoogleAPIs logo) and copy the clientID of your WEB CLIENT

screenshot 1

GoogleSignin.configure({
                scopes: [
                    'email', 'profile', 'https://www.googleapis.com/auth/plus.profile.emails.read', 'https://www.googleapis.com/auth/plus.login'
                ],
                webClientId: 'WEB-CLIENT-ID',
                offlineAccess: true

@jonathanpalma
Just want to confirm that your solution did work! thank you!

@ronzilca You're welcome buddy!! :smile:

In my case it worked when I generated google-services.json with DEBUG SHA1 (debug.keystore).
To make this work in release mode you need to use release keystore.
Also the APK must be signed in debug mode, add this lines in android/app/build.gradle and the corresponding configuration in android/gradle.properties

```
signingConfigs {
debug {
if (project.hasProperty('MYAPP_DEBUG_STORE_FILE')) {
storeFile file(MYAPP_DEBUG_STORE_FILE)
storePassword MYAPP_DEBUG_STORE_PASSWORD
keyAlias MYAPP_DEBUG_KEY_ALIAS
keyPassword MYAPP_DEBUG_KEY_PASSWORD
}
}
}

buildTypes {
    debug {
        signingConfig signingConfigs.debug
    }
}

```

I used this link to resolve the issue and my app is working fine.
http://developerextensions.com/index.php/help/230-Google-signin-returns-12500,-12501-error-code-

Don't forget to do the needful on Google Developer console before following the steps in the link.
All the best

Thanks works now! I just had to redo the whole sha-1 signing procedure (https://developers.google.com/android/guides/client-auth). Cause i was giving the app a different "com.xxxxxxxx"-name while signing so maybe i messed up something.

I also want to mention that i still have commented out this line in myapp/android/app/build.gradle

// apply plugin: 'com.google.gms.google-services' // <--- this should be the last line

Cause i still get this error, when i try to build: http://stackoverflow.com/questions/38191170/multiple-dex-files-define-lcom-google-firebase-firebaseexception/40663695#40663695

@jonathanpalma work's for me thanks dude 😄 !

In an effort to clean the issues up, this is being closed. Please open a new issue if you're still experiencing a problem.

Was this page helpful?
0 / 5 - 0 ratings