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

WRONG SIGNIN Error: unknown status code: 12501(…) #98

Closed
jcrjaci opened this issue Jul 21, 2016 · 12 comments
Closed

WRONG SIGNIN Error: unknown status code: 12501(…) #98

jcrjaci opened this issue Jul 21, 2016 · 12 comments

Comments

@jcrjaci
Copy link

jcrjaci commented Jul 21, 2016

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

@devfd
Copy link
Contributor

devfd commented Jul 22, 2016

hello @jcrjaci

please have a look at the Android guide FAQ.

@jcrjaci
Copy link
Author

jcrjaci commented Jul 22, 2016

@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

@rakannimer
Copy link

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

@eranbes
Copy link

eranbes commented Aug 24, 2016

Sorry, same issues here. When canceling login.

@jonathanpalma
Copy link

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

@ronzilca
Copy link

ronzilca commented Dec 1, 2016

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

@jonathanpalma
Copy link

@ronzilca You're welcome buddy!! 😄

@maggialejandro
Copy link
Contributor

maggialejandro commented Mar 15, 2017

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
     }
 }

@adeoluwagbemiga
Copy link

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

@matthiasprieth
Copy link

matthiasprieth commented Apr 19, 2017

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

@Allainpierre
Copy link

@jonathanpalma work's for me thanks dude 😄 !

@vonovak
Copy link
Member

vonovak commented May 17, 2018

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

@vonovak vonovak closed this as completed May 17, 2018
@react-native-google-signin react-native-google-signin locked as resolved and limited conversation to collaborators Oct 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests