4
votes

I implemented Firebase authentication and it works when app is installed from Android Studio but not from exported release apk (or from Google Playstore).

I did the following:

  • Copied the app SHA-1 certificate fingerprint from Google Play Store - Release managemet - App signing.
  • On Firebase console under Project settings - My App I Added Fingerprint and pasted the SHA-1 characters from Google Playstore Console.
  • Now I have 2 SHA-1 (Debug and Release) under Firebase SHA certificate fingerprints
  • I downloaded the google-services.json and added it to the root of my /app directory and re-generated signed apk.
  • The PhoneAuthProvider.OnVerificationStateChangedCallbacks calls public void onVerificationFailed(FirebaseException e) with the following exception returned:

    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.
    

I even generated the SHA-1 from command line using release keystore and the same SHA-1 from Google Playstore is generated.

Also, why are developers hiding their SHA-1 keys in screenshots?

1
"why are developers hiding their SHA-1 keys in screenshots?" : because if i have access to your key i can request and modify your data from your firebase db - kkarakk

1 Answers

2
votes

Ok this is strange but it worked nontheless:

I removed all SHA-1 keys from Firebase and added the Google Playstore SHA-1 certificate fingerprint from Upload certificate instead of App signing certificate