I am trying googleSignIn with Firebase in flutter .My App is Already connected with Firebase firestore and Does Read/Write (Crud) Operations Perfectly.NOw I want to Integrate GoogleSignIn .But I am Getting an Un-handled exception.. I have Tried a tons of Solution of this Platform Answers and Github ,But Unfortunately non of them could solve my problem.
E/flutter ( 2995): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: ,null)
final GoogleSignInAccount googleSignInAccount = await _googleSignIn.signIn();
final GoogleSignInAuthentication googleSignInAuthentication =
await googleSignInAccount.authentication;
final AuthCredential credential = GoogleAuthProvider.getCredential(
accessToken: googleSignInAuthentication.accessToken,
idToken: googleSignInAuthentication.idToken,
);
final AuthResult authResult = await _firebaseAuth.signInWithCredential(credential);
final FirebaseUser user = authResult.user;
assert(user.email != null);
assert(user.displayName != null);
assert(user.photoUrl != null);
name = user.displayName;
email = user.email;
imageUrl = user.photoUrl;
assert(!user.isAnonymous);
assert(await user.getIdToken() != null);
final FirebaseUser currentUser = await _firebaseAuth.currentUser();
assert(user.uid == currentUser.uid);
