2

When I try to log in with google the following exception is raised.

PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null).

How to solve this exception. I am stuck on this from 4 days.

  final GoogleSignIn _googleSignIn = GoogleSignIn();
  final FirebaseAuth _auth = FirebaseAuth.instance;

  Future<FirebaseUser> _handleSignIn() async {
    GoogleSignInAccount googleUser = await _googleSignIn.signIn();

    GoogleSignInAuthentication googleAuth = await googleUser.authentication;
    AuthCredential credential = GoogleAuthProvider.getCredential(
      accessToken: googleAuth.accessToken,
      idToken: googleAuth.idToken,
    );
    FirebaseUser user = await _auth.signInWithCredential(credential);
    print("signed in " + user.displayName + "  " + user.email);
    return user;
  }
4

2 回答 2

2

If no error in your code then your Auth is complete. but run code after this Process https://flutter.dev/docs/deployment/android

于 2019-03-06T09:11:29.083 回答
-1

It might come with the configurations, or may be google_services.json is not at right place.

于 2019-03-05T09:10:08.440 回答