发布 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证书指纹
粘贴到证书指纹
文本域
点击保存
这篇关于发布 Flutter 应用后,Google 登录不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!