“此应用无权使用 Firebase 身份验证"在模拟器中 [英] "This app is not authorized to use Firebase Authentication" in Emulator

查看:18
本文介绍了“此应用无权使用 Firebase 身份验证"在模拟器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm getting this error when I try to run my app on emulator.

我做了什么:

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

事实上,当我在真实设备上运行该应用程序时,它运行良好,我可以登录.

In fact when I run the app on a real device it runs perfectly and I can login.

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 电话身份验证在模拟器中不起作用.

In order to prevent abuse the firebase phone authentication wont work in emulator.

但是如果你想要它用于测试目的,那么你应该添加使用一些在可在模拟器中运行的 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 控制台 -> 身份验证 -> 登录方法 -> 电话并检查测试电话号码(可选)"字段.

Go to your firebase console -> Authentication -> SIGN-IN Method -> Phone and check the "Phone numbers for testing (optional)" field.

这篇关于“此应用无权使用 Firebase 身份验证"在模拟器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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