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

i already try with the two clients id that are in the oauth 2
Hello @jcrjaci, here are some things you can try :
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

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

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