此应用无权使用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

查看:89
本文介绍了此应用无权使用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

Easiest way would be to connect/sync to firebase from

工具> 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天全站免登陆