Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flutter firebase phone auth error a safety net token was passed but no matching sha-256 was registered in the firebase console

I register sha-1 release , debug key on firebase and I All did firebase register tutorial

but I got this message when I call verifyPhoneNumber();

in the verificationFailed: (AuthException exception) {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 ] 

I thought i don't need to register sha256 if I register sha1 but it says like that

what is this reason , how can i solve this problem??

like image 610
SILENMUS Avatar asked Nov 30 '25 06:11

SILENMUS


1 Answers

The solution to this is:

  1. Press 'Win + R' and run "resmon.exe".
  2. Go to CPU tab and search for "build" in Associated Handles search bar.
  3. Right click on "java.exe" process and click on END PROCESS.
  4. Run flutter clean to clean your project dependencies.
  5. Download new google-services.json file from firebase and add it to app folder in flutter project.
  6. Run pub get to get all dependencies again.
  7. Run your project.

Then you're good to go. It worked for me.

like image 61
Hydra Avatar answered Dec 01 '25 19:12

Hydra



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!