Flutter 应用发布后,Google 登录不起作用 [英] Google sign in doesn't work after release of flutter app
问题描述
我使用 Flutter 开发了一个应用,并使用以下命令在我的设备上进行了测试:
I developed a app with Flutter and tested on my device using the command:
flutter run --release
一切正常.我还尝试使用以下方法构建应用程序:
and everything worked fine. I also tried building the app with:
flutter build apk --release
并手动安装它,仍然一切正常.
我在商店上传了,现在登录不起作用了.我尝试查看 logcat,尝试登录时出现的错误是:
and installing it manually, and still everything was ok.
I uploaded on the store, and now the login doesn't work anymore.
I tried looking at the logcat and the error i get when i try to login is:
I/flutter: exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 12500: , null)
我尝试添加 appCompat 依赖项并检查了 SHA1 密钥,一切都在正确的位置,如果从商店下载它不再起作用,我不知道为什么.
I tried adding the appCompat dependency and I checked the the SHA1 keys, everything is in the right place, I can't figure out why when I download if from the store it doesn't work anymore.
推荐答案
您可能必须向 API 提供商(在本例中为 Firebase)注册您的 Play 商店应用签名密钥.
You likely have to register your Play Store app signing key with API providers (in this case Firebase).
在您的 Google Play 管理中心中,访问设置 >应用签名
In your Google Play Console, visit Setup > App signing
复制SHA-1证书指纹
在您的 Firebase 控制台中,访问设置 >项目设置
In your Firebase Console, visit Settings > Project settings
点击添加指纹
将复制的SHA-1证书指纹
粘贴到证书指纹
文本字段
Paste copied SHA-1 certificate fingerprint
into Certificate fingerprint
textfield
点击保存
这篇关于Flutter 应用发布后,Google 登录不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!