简体   繁体   中英

Android Firebase Authentication Not Working On Release APK

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM