firebase - flutter firebase phone auth error a security net token was pass but no matching sha-256 was registered in the firebase console
问题描述
我在 firebase 上注册了 sha-1 release 和 debug key,我都做了 firebase 注册教程
但是当我调用 verifyPhoneNumber(); 时收到此消息;
在验证失败:(AuthException异常){exception.message};
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.
[ A safety_net_token was passed, but no matching SHA-256 was registered in the
Firebase console.
Please make sure that this application's packageName/SHA256 pair is registered in
the Firebase Console ]
我以为如果我注册 sha1 就不需要注册 sha256 但它是这样说的
这是什么原因,我该如何解决这个问题?
解决方案
解决方案是:
- 按“Win + R”并运行“resmon.exe”。
- 转到 CPU 选项卡并在 Associated Handles 搜索栏中搜索“build”。
- 右键单击“java.exe”进程,然后单击END PROCESS。
- 运行
flutter clean
以清理您的项目依赖项。 - 从 firebase 下载新的 google-services.json 文件并将其添加到 Flutter 项目的 app 文件夹中。
- 再次运行
pub get
以获取所有依赖项。 - 运行您的项目。
那你就可以走了。它对我有用。
推荐阅读
- next.js - next-i18next 不支持assetPrefix url?
- upwork-api - Upwork API 返回 405/可能资源未共享
- reactjs - 如何导出对 word 文档的反应
- ads - Is there a way to use Microsoft Advertising in a Desktop App that im developing in VS2019?
- ember.js - I want to create a ember table component whose value is updated dynamically [Ember.js]
- javascript - 未找到集合
- php - 我的“if else”条件不起作用 php website codeigniter
- python - 学习 Python。P是做什么的?
- testing - 我的网站在 LiteSpeed 上运行,但当我测试结果是:运行:Imunify360-Webshield 1.8
- java - 模拟 @UpdateTimestamp 休眠注解