0
votes

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.

2

2 Answers

0
votes

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.

0
votes

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.