flutter firebase phone auth error a safety net token was passed but no matching sha-256 was registered in the firebase console
3,018
The solution to this is:
- Press 'Win + R' and run "resmon.exe".
- Go to CPU tab and search for "build" in Associated Handles search bar.
- Right click on "java.exe" process and click on END PROCESS.
- Run
flutter clean
to clean your project dependencies. - Download new google-services.json file from firebase and add it to app folder in flutter project.
- Run
pub get
to get all dependencies again. - Run your project.
Then you're good to go. It worked for me.
![SILENMUS](https://i.stack.imgur.com/a3aZ8.gif?s=256&g=1)
Author by
SILENMUS
Updated on December 25, 2022Comments
-
SILENMUS over 1 year
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??
-
SardorbekR over 3 yearshave you found a solution
-
SILENMUS over 3 yearsjust register project sha-256 on firebase console then all good
-
-
Janpan over 3 yearsAfter adding the SHA fingerprints, you have to download the google-services.json file again and add it to your project again (replace the previous one). Also double check that the package name in your google-services.json file corresponds to the package name or project id in your build.gradle. e.g. com.example.etc...
-
MUHAMMAD SHAHID RAFI C P over 2 yearswhat about flavor enabled flutter project ? projectid is com.companyname.appname and package name is com.companyname.appname.dev