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

寵の児 提交于 2020-02-07 03:14:04

问题


I am using firebase for google authentication in my flutter app. I registered app in the firebase and set all configurations like adding SHA1 and SHA256 key, and all. However, I get the error:

    final FirebaseAuth _auth = FirebaseAuth.instance;
    final GoogleSignIn googleSignIn = new GoogleSignIn();

    Future<FirebaseUser> _signIn() async{
      GoogleSignInAccount googleSignInAccount = await googleSignIn.signIn();
      GoogleSignInAuthentication googleSignInAuthentication = await googleSignInAccount.authentication;

      final AuthCredential credential = GoogleAuthProvider.getCredential(
        accessToken: googleSignInAuthentication.accessToken,
        idToken: googleSignInAuthentication.idToken
      );

      final FirebaseUser user = await _auth.signInWithCredential(credential);

      print("Sign In "+user.displayName);
      return user;
       }

It is needed to return user credentials. However, It throws following error.

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

As per the links Unhandled Exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null), I have added my mail for mail support, added google-services.json file. However, that doesn't solve my problem.

来源:https://stackoverflow.com/questions/56440770/exception-has-occurred-platformexception-platformexceptionsign-in-failed-com

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!