Flatter firebase电话验证错误传递了安全网令牌,但在firebase控制台中未注册匹配的sha-256

Flatter firebase电话验证错误传递了安全网令牌,但在firebase控制台中未注册匹配的sha-256,firebase,flutter,firebase-authentication,sha256,Firebase,Flutter,Firebase Authentication,Sha256,我在firebase上注册sha-1版本,调试密钥 我都做了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 i

我在firebase上注册sha-1版本,调试密钥 我都做了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,我想我不需要注册SH256 但它是这样说的

这是什么原因,,
如何解决此问题???

此问题的解决方案只是在Firebase控制台上注册Sha-256


❔❔ 但仍然不知道原因。

解决办法是:

  • 按“Win+R”并运行“resmon.exe”
  • 转到CPU选项卡并在相关句柄搜索栏中搜索“build”
  • 右键单击“java.exe”进程,然后单击结束进程
  • 运行
    flatterclean
    以清除项目依赖项
  • 从firebase下载新的google-services.json文件,并将其添加到Flatter项目的app文件夹中
  • 运行
    pub get
    再次获取所有依赖项
  • 运行您的项目

  • 那你就可以走了。这对我很有用。

    你找到解决方案了吗只要在firebase控制台上注册项目sha-256,然后一切正常添加sha指纹后,你必须再次下载google-services.json文件并再次将其添加到你的项目中(替换上一个)。还要仔细检查google-services.json文件中的包名是否与build.gradle中的包名或项目id相对应。e、 g.com.example.等等。。。