此应用无权使用 Firebase 身份验证.请验证 Firebase 控制台中配置的包名称和 SHA-1 是否正确 [英] This app is not authorized to use Firebase Authentication.Please verify that the correct package name and SHA-1 are configured in the Firebase Console

查看:24
本文介绍了此应用无权使用 Firebase 身份验证.请验证 Firebase 控制台中配置的包名称和 SHA-1 是否正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Firebase 身份验证工作正常,调试构建突然开始失败,没有任何代码更改,记录以下消息

Firebase auth was working fine, the debug build suddenly started failing without any change of code, logging the folloing message

D/PhoneAuthActivity(7392):signInWithCredential:failure:com.google.firebase.auth.FirebaseAuthException:此应用无权使用 Firebase 身份验证.请确认在 Firebase 控制台中配置了正确的包名称和 SHA-1.[应用验证失败].

D/PhoneAuthActivity( 7392): signInWithCredential:failure:com.google.firebase.auth.FirebaseAuthException: This app is not authorized to use Firebase Authentication. Please verifythat the correct package name and SHA-1 are configured in the Firebase Console. [ App validation failed ].

成功登录和失败之间唯一值得注意的操作是android studio升级.

The only notable action inbetween a successful login and failure is android studio upgrade.

推荐答案

当您更新 Android Studio 时,用于签署调试应用程序的调试密钥可能已更改.只需在 Firebase 控制台中添加调试密钥的新 SHA-1 校验和.

When you updated Android Studio, the debug key which is used to sign debug apps might have changed. Just add the new SHA-1 checksum of your debug key in the firebase console.

最简单的方法是从

工具>Firebase>身份验证>连接>同步

Tools>Firebase>Authentication>Connect>Sync

<小时>

如果您想手动执行或发布密钥库,请先使用以下命令生成 SHA-1 校验和:


If you want to do it manually or for release keystore, first generate SHA-1 checksum using following command:

keytool -list -v -keystore KEYSTORE_PATH -alias ALIAS_NAME

然后复制 SHA-1 校验和并转到:

Then copy the SHA-1 checksum and go to:

Firebase 控制台 > 您的项目 > 应用设置 > 添加指纹

Firebase Console > Your project > Settings of the app > Add Fingerprint

有关详细信息,请阅读本指南:验证您的客户 |适用于 Android 的 Google API

For more info, read this guide: Authenticating Your Client | Google APIs for Android

这篇关于此应用无权使用 Firebase 身份验证.请验证 Firebase 控制台中配置的包名称和 SHA-1 是否正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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