I have followed all the steps from here, I also added the SHA1 key in firebase console.
This is my code
void handleGoogleSignIn() async {
String errorMessage = "success";
GoogleSignInAccount _googleSignInAccount = await _googleSignIn.signIn();
GoogleSignInAuthentication googleSignInAuthentication =
await _googleSignInAccount.authentication;
AuthCredential _credential = GoogleAuthProvider.getCredential(
idToken: googleSignInAuthentication.idToken,
accessToken: googleSignInAuthentication.accessToken);
try {
AuthResult _authResult = await _auth.signInWithCredential(_credential);
} catch (error) {
switch (error.code) {
case "ERROR_INVALID_CREDENTIAL":
errorMessage = "Invalid credentials";
break;
case "ERROR_ACCOUNT_EXISTS_WITH_DIFFERENT_CREDENTIAL":
errorMessage = "This accouont exists withother credentials";
break;
case "ERROR_OPERATION_NOT_ALLOWED":
errorMessage = "Signing in with Email and Password is not enabled.";
break;
default:
errorMessage = "An undefined Error happened.";
}
}
showErrorOrNavigate(errorMessage);
}
I created a debug. keystore by following these steps
Exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null) E/flutter (30467): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7) E/flutter (30467): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33) E/flutter (30467): E/flutter (30467): #2 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:349:48) E/flutter (30467): #3 MethodChannelGoogleSignIn.signIn (package:google_sign_in_platform_interface/src/method_channel_google_sign_in.dart:45:10)`
Proof of SHA1 key added in firebase console:
I am not able to find my mistake.