google-signin: WRONG SIGNIN Error: DEVELOPER_ERROR at new GoogleSigninError
I can press the button and select a google profile, but get this error. It looks like the user is null at the point of sign in. I followed the tutorial pretty closely, is there something I’m doing wrong? My code:
_signIn() {
GoogleSignin.signIn()
.then((user) => {
console.log(user);
this.setState({user: user});
this.props.navigator.push({
component: Account
});
})
.catch((err) => {
console.log('WRONG SIGNIN', err);
})
.done();
}
async _setupGoogleSignin() {
try {
await GoogleSignin.hasPlayServices({ autoResolve: true });
await GoogleSignin.configure({
webClientId: 'MY-CLIENT-ID',
offlineAccess: false
});
const user = await GoogleSignin.currentUserAsync();
console.log(user);
this.setState({user});
}
catch(err) {
console.log("Play services error", err.code, err.message);
}
}
<GoogleSigninButton
style={{width: 312, height: 48}}
size={GoogleSigninButton.Size.Wide}
color={GoogleSigninButton.Color.Light}
onPress={() => { this._signIn(); }}/>
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 21
- Comments: 21
I had the same problem, was using the wrong client Id ie.
"oauth_client": [ { "client_id": "first client_id",//was using this right here<-- "client_type": 1, "android_info": { "package_name": "com.myap", "certificate_hash": "*********" } }, { "client_id": "when i used this one, it worked",//use this right here <--- "client_type": 3 } ],This is code from the exported google-services json fileIn my case I was using the android webClientId generating this error you need user the web webClientId it is generated in the console!
This is debug
I experienced the
DEVELOPER_ERROR 10as I was using the wrongweb client id.Firebase was not creating the client is in my
google apisconsole, but it was generating it’s ownweb client idinside firebase. The problem was solved once I added thatweb client idto my android app insideHead to your firebase app,
Authentication -> Sign-in methods -> GoogleYou will find the list ofWhitelisted clients idsand the option to add newids@Anees-Raja I just added a debug section too . I copied/pasted from release
This is described there : https://github.com/devfd/react-native-google-signin/blob/master/android-guide.md#e-getting-developer_error-error-message-on-android-when-trying-to-login
@havinhthai I think it worked because android was providing .keystore to only release version and after adding the above fix by @Kisepro we are providing it to debug version as well. so now sign in can recognize the SHA1 id which was provided you during client id creation on google console.
@hustlerism sure, look into your build.gradle in app folder. android { … signingConfigs { debug { storeFile file(‘path to your debug.keystore’) storePassword “abc” keyAlias “abc” keyPassword “abc” }
… }
just provide path for debug.keystore . copy paste debug.keystore to exact same folder structure, and you are good to go .
I’m getting the same error! My webClientId is correct. It’s fine on one computer but it’s not when I copy the debug.keystore and google-services.json to the other computer.
thank you man you are an awesome
So the solution to this problem form me were two things, firstly the answer by @Kisepro and then the answer by @muganwas after that rebuild and your app should run smoothly.
@havinhthai it worked because you used the correct client Id, I doubt there’s anything more to it but I could be wrong.
Hi muganwas. thanks a ton!