Reputation: 85
I am using flutter and firebase OTP. The SMS is received while running the debug APK of my app.
However, I am getting this message while running the release APK using the command flutter run --release
.
This is the returned 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. ]
Kindly note that I am running this app directly on my phone and not by installing it from google play.
I tried the following on firebase console:
I tried all the solutions presented by similar questions such as adding an email in firebase, adding google play keys, etc. and unfortunately none of them worked.
Update:
Solved,
the problem was wrong naming inside the manifest file as the error message stated:
Please make sure that this application’s "packageName/SHA256" pair is registered in the Firebase Console.
Usually, it is the sha1 or sha256 keys, however this time it was the package name.
Upvotes: 4
Views: 2866
Reputation: 21
You will have to add 4 SHA keys.
Run cd android
, then run ./gradlew signingReport
I assume you have already added debug SHA keys, because you can send OTP on debug builds.
Scroll up on the output of signingReport and look for Variant: release
, copy SHA1 and SHA-256 from here and add them into firebase app, in addition to the debug keys.
Hope this helps!
Upvotes: 2
Reputation: 31
Upvotes: 3
Reputation: 710
You need to add SHA Keys in firebase console, to get SHA KEY
gradlew signingReport
You will find the SHA-1 fingerprint in the "Gradle Console"
Add this SHA-1 fingerprint in firebase console and test again
Upvotes: 1
Reputation: 2415
You have to generate SHA-1 for relase build and add it to the firebase console for the same project that you have registered.
Upvotes: 2