Flutter 应用发布后,Google 登录不起作用 [英] Google sign in doesn't work after release of flutter app

查看:41
本文介绍了Flutter 应用发布后,Google 登录不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 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).

  1. 在您的 Google Play 管理中心中,访问设置 >应用签名

  1. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆