I had created a sign in page in flutter using phone Authentication. In which i am getting the error:
E/FirebaseAuth(21546): [SmsRetrieverHelper] SMS verification code request failed: unknown status code: 17028 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/flutter (21546): 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 had already get the SHA1 and SHA256 key from the cmd by using the following steps:
In cmd, visited the path where java jdk is installed(in my case:C:\Program Files\Java\jdk1.8.0_212)
Then pasted the following command and hit enter
keytool -list -v -keystore "C:\Users\Mehul Jain.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
After that i got the key as shown in Screenshot.
copied both the keys and pasted in the firebase Console (as shown in Screenshot below)
App is working correctly. And when I tried signing through test mode (i.e. entering the mobile no. and otp) and run the app with the test mode details, the app was working 100%.
But if I want to add the mobile number from the app and try to get SMS the error comes on the screen. I had tried various other mobile number but still not worked(mobile number are not entered in test mode).
if are using emulator then safety net fails make sure you using a legitimate with Android Device
it is possible that u using wrong keystore. best method for fnding
debug SHA key is Gradle >> signinreport>>rightclick>>run
I suggest you to use this free library OTP_VERIFICATION API
I have also tried this, and it is the simplest API ever.
Related
I am implementing add a card to google pay. I download the demo project and install the demo app. And I basically copy code from that demo to my project but almost all functions return the error Calling package not verified. I can not find anything for package verifies.
UPDATE (probable solution):
I found how to generate SHA-256 key in doc.
# Function to display your SHA-256
$ keytool -printcert -jarfile my-push-provisioning-app.apk | grep SHA256
and send the result of this command to google via the form in doc...
I did it and now I am waiting for some response. It could take them 2 weeks...
I am just wondering if they send me an acceptance email or if it just starts work ...
For me the issue was:
com.google.android.gms.common.api.ApiException: 15009: Calling package not verified
I've realized that it only reproduced on the debug build type. After I switched to release, the issue was resolved.
ok for someone that is encountering this issue... hope this help someone
com.google.android.gms.common.api.ApiException: 15009: Calling package not verified
the 15009 is an error
https://developers.google.com/pay/issuers/apis/push-provisioning/android/support/troubleshooting#debugging_tapandpay_unavailable_15009_errors
basically what it says , the apk build you have is not whitelisted push provisioning at google
you need to request a form to allow to whitelist it
what you need is get your SHA-256 of your key
and request it to allow, follow the link below for more info:
https://developers.google.com/pay/issuers/apis/push-provisioning/android/allowlist#allowlisting_internal_builds_of_your_app
if your build is in playstore or google console, the fingerprint can be grab automatically by them so no need to request ....but if you have a apk build that is created from a CI Pipeline that uses an upload key not app signing key , then you had to manually request it using the Sha-256 of upload key
this is why for the commenter above the release build work for them
because it gets the SHa-256 from google console (App signing key) automatically
I've built the App on android studio. When I connect my phone to my PC and build it directly through Android Studio it works. I get the phone verification code and am able to sign in. But when I generate a signed APK to distribute it to others, it always says "Verification Failed" and doesn't let me sign in.
I'm pretty sure there's no problem with the code, because it works perfectly when I build it through Android Studio directly onto my phone.
What Ive Tried:-
I followed the steps in this link and changed the SHA-1 code in my firebase console to the one provided in my Google Console, it still says verification failed.
I also tried to keep only one SHA-1 key in my firebase console which is the one i found in my android project, updated the google-services.json file and tried generating a signed APK, its still says verification failed.
Generate a new SHA1 fingerprint from the console in Android Studio using
keytool -list -v -keystore <absolute path of Keys generated during signed APK generation> -alias <app alias name>
Paste the generated fingerprint in the firebase console and delete the older one.
Hope this works!
I have attached firebase on my existing android project and ran it. Here is the scenario:
If the app ran from android studio via developer mode, it(Firebase sign in via phone number) runs smoothly and I manage to log in.
However, whenever I build signed debug apk, Firebase does not allow to sign in. It gives the following message:
This app is not authorized to use Firebase authentication. Please
verify the correct package name and SHA-1 are configured in the
firebase console (App Validation Failed).
I have SHA-1 and SHA-256 key installed on Firebase console generated from my windows machine.
I would have normally provided the code however, I am guessing there is nothing wrong with the code. It works fine with the debug process. I have changed to the up-to-date google-services file from console.
Any help would be highly appreciated. Thanks in advance.
Here is my error:
When debugging, I used the normal debug key from .android/debug.keystore and this key is stored in the Firebase SHA1 field.So it worked perfectly. While trying to create a signed version, I generated a separate keystore file and created signed apk using that. Now, since the SHA1 key varied from the debug, the app was not recognized on the firebase console.
I changed the signed key to debug key. I did not want to go through a lot of changes.
If you are using another key to sign your production apk, you can obtain SHA-1 fingerprint like this:
keytool -exportcert -list -v \
-alias <your-key-name> -keystore <path-to-production-keystore>
Then you will obtain something like this:
Certificate fingerprint: SHA1: DA:39:A3:EE:5E:6B:4B:0D:32:55:BF:EF:95:60:18:90:AF:D8:07:09
After that just copy SHA1 fingerprint and paste in your firebase's project adding new digital print in following menu:
Project Overview => Pulse in the cog (settings) => Project Configuration => scroll to bottom => add digital fingerprint.
I am trying to integrate Google Sign in to my application, but I get errors that I cannot understand.
I have configured everything according to the tutorial here, but it would not authenticate me. I am presented with the login panel that shows my accounts, and the login activity OnActivityResult fires, when looking into the GoogleSignInResult, I have a Status with a statusCode 8 and no message.
It seems to be related to this, but it is a bit confusing.
Any idea ?
Check out the answer to this question: An INTERNAL_ERROR (8) occurred when requestEmail from GoogleSignInOptions on Android
If you get error code 8 (INTERNAL_ERROR), please double check your app registration in dev console. Note that every registered Android client is uniquely identified by the (package name, Android Signing Certificate SHA-1) pair. If you have multiple package names / signing certificate for your debug and production environments, make sure to register every pair of them. To verify:
Open the Credentials page and select your project
Make sure every pair has an Android typed OAuth 2.0 client IDs.
To create a new OAuth 2.0 client ID for your Android client, select New Credentials->OAuth2 Client ID from the dropdown, select Android and input your Package name / Signing-certificate fingerprint there.
To get your signing key certificate SHA-1:
Standard Debug Key
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
Other (Custom) Key
keytool -list -v -keystore $YOUR_KEYSTORE_LOCATION
Good day. I ran into a similar problem and spent 1.5 days solving it.
Tips to help you:
First check valid the package name and fingerprint SHA1.
If your application did not pass verification and was not released, then make sure that the user to be authorized is in the list of testers (this can be checked in APIs & Service -> OAuth consent sreen -> Test users)
There is a suspicion that all letters in the package name in android studio should be lowercase.
In my case, it helped to create a new project, transfer old files to it, and create a new OAuth Client IDs.
I have created a simple android app and signed it using the Eclipse export method.
Then I use the export cert command of keytool.
keytool -exportcert -alias my_alias -keystore "G:\mypath\app\android.keystore"|"C:\ssl\bin\openssl" sha1 -binary |"C:\ssl\bin\openssl" base64
I got some "hash code". I added this hash code to the facebook panel for native android app and checked the login with facebook.
While logging in, facebook gives and error stating that the hash code of the app is not allowed. i.e. is not given on the list of allowed has codes.
What am I doing wrong ? Is the question clear ? Please comment I will make the necessary changes.
Ideally you add the key hash to two places:
your overall developer settings (so that you can run the Facebook samples)
the settings for each of your apps themselves
These are described in steps 4 & 5 of the Getting Started guide, respectively: https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/
Make sure you have done both.
Hmmm. Sound like a mismatch of the android key. When running your app from a device (not the emulator) you need to replace the Hash key that you got on your development PC with the one on the app. Get the key from your device and go to facebook.com/developers.