Flutter Google 登录平台异常(sign_in_failed,ApiException:10)错误

问题描述 投票:0回答:1

尝试在我的 Flutter 应用程序中实现 Google Sign-In 时遇到 PlatformException。登录过程中发生错误,抛出 ApiException: 10。错误日志如下:

E/flutter (12293): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null)
E/flutter (12293): #0      GoogleSignInApi.signIn (package:google_sign_in_android/src/messages.g.dart:221)
E/flutter (12293): <asynchronous suspension>
E/flutter (12293): #1      GoogleSignInAndroid._signInUserDataFromChannelData (package:google_sign_in_android/google_sign_in_android.dart:111)
E/flutter (12293): <asynchronous suspension>
E/flutter (12293): #2      GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:278)
E/flutter (12293): <asynchronous suspension>
E/flutter (12293): #3      GoogleSignIn.signIn.isCanceled (package:google_sign_in/google_sign_in.dart:431)
E/flutter (12293): <asynchronous suspension>

我尝试过的:

  1. 我在过去 5 年里发布了这个应用程序,相同的包和签名,并且与旧应用程序完美配合,(代码库:Kotlin)

  2. 应用gmail在调试模式下登录没有问题,

2.确认 Google Cloud Console 中启用了 Google Sign-In API。 检查 OAuth 2.0 客户端 ID 是否与我的应用程序的包名称和 SHA-1 证书指纹匹配。

3.确认 AndroidManifest.xml 包含 Google Sign-In 的正确元数据。

4.确保在 Google 登录的 Dart 代码中正确实现错误处理。

如何解决 Flutter 实现 Google Sign-In 时出现的 PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null) 错误? Google Cloud Console 或 Flutter 项目设置中是否有我可能缺少的特定配置?

任何有关可能导致此问题的原因以及如何解决该问题的指导或建议将不胜感激。?

android flutter dart google-signin
1个回答
0
投票

您是否再次下载了GoogleService-Info.plist? 就我而言,它是这样解决的。

© www.soinside.com 2019 - 2024. All rights reserved.