简体   繁体   English

以下代码中有一个异常。 OAuth使用Google-firebase颤抖地登录

[英]There is an Exception in following code. Oauth login with google-firebase in flutter

When I try to log in with google the following exception is raised. 当我尝试使用google登录时,出现以下异常。

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. 我从4天开始就一直坚持下去。

  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;
  }

If no error in your code then your Auth is complete. 如果您的代码中没有错误,则您的身份验证已完成。 but run code after this Process https://flutter.dev/docs/deployment/android 但在此过程之后运行代码https://flutter.dev/docs/deployment/android

它可能随配置一起提供,或者google_services.json不在正确的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Firebase 进行 Flutter 谷歌登录 - Flutter google login with firebase flutter 谷歌登录不适用于 firebase - flutter google login not working with firebase Firebase不会调用侦听器的onDataChange()。 无法在Java客户端(而非Android)上使用新的Google Firebase - Listener's onDataChange() is not called by Firebase. Could not use new Google-Firebase on Java client, not Android 在 Flutter 应用程序(Google + FireBase)上跳过登录页面 - Skip login page on Flutter app(Google + FireBase) Flutter Google 登录未在 Firebase 中注册 - Flutter Google Login not Getting Registered in Firebase Flutter:Google 和 Firebase 登录在生产环境中不起作用 - Flutter: Google and Firebase login not working in production 如何在 Flutter 上获取 Firebase Firestore 异常代码? - how to get Firebase Firestore exception code on Flutter? Firebase Google 登录返回 403 需要 OAuth 同意 - Firebase Google Login return 403 require OAuth consent 这个flutter代码有什么问题。 我试图从 firebase 读取数据 - What is the problem with this flutter code. Im trying to read the data from firebase 为 Google 和 Facebook 登录向 OAuth Firebase 身份验证添加范围 - Adding Scope to OAuth Firebase Auth for Google and Facebook Login
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM