android - 模拟器中的"This app is not authorized to use Firebase Authentication"

标签 android firebase firebase-authentication firebaseui

当我尝试在模拟器上运行我的应用程序时,出现此错误。

我做了什么:

  1. 我正在使用 Firebase-UI 并运行 Android O
  2. 我已更新 Play 商店。
  3. 我已将所有 SHA-1 代码添加到 Firebase 控制台,并且软件包名称匹配。

事实上,当我在真实设备上运行该应用程序时,它运行完美并且我可以登录。

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.
 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. Is app running on a physical device? ]
 at com.google.android.gms.internal.jz.zzK(Unknown Source:239)
 at com.google.android.gms.internal.kp.zza(Unknown Source:2)
 at com.google.android.gms.internal.kq.run(Unknown Source:37)
 at android.os.Handler.handleCallback(Handler.java:789)
 at android.os.Handler.dispatchMessage(Handler.java:98)
 at android.os.Looper.loop(Looper.java:164)
 at android.app.ActivityThread.main(ActivityThread.java:6541)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

最佳答案

为了防止滥用,Firebase 电话身份验证在模拟器中不起作用。

But if you want it for testing purpose then you should add use some testing phone number in firebase console that will work in emulator.

转到您的 Firebase 控制台 -> 身份验证 -> 登录方法 -> 电话并选中“用于测试的电话号码(可选)”字段。

enter image description here

关于android - 模拟器中的"This app is not authorized to use Firebase Authentication",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61162985/

相关文章:

android - 使用 FirebaseListAdapter 需要对 gradle 进行哪些更改?

javascript - 无法访问 javascript 数组,并且循环不起作用

angular - 与订阅的可观察对象相关的注销权限错误

android - ConstraintLayout 与 RelativeLayout 和 CardView - 缓存和内存空间

javascript - 查询和改变Firebase实时数据库多对多(双向)关系

ios - 用户注销后 Firebase Facebook 登录按钮不会更改

Firebase 身份验证 : How can I detect that firebase trying to auto signIn current user?

android - 使用 "Logout"facebook 按钮时如何调用事件?

java - 优化循环中数组的选择

android - RecyclerView 周围的白色边框