Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter/Firebase Google login not working after building apk file

I have made android app that uses firebase and google_sign. Then I have release apk by flutter build apk. But after installing that apk file locally in my phone the google login page does't works although I works perfectly.

I am aware that when publishing the app to playstore we need to add provided SHA1 key but if I am not planing to release to google play then is there any way to make with work?

like image 200
Abishek Bashyal Avatar asked Nov 29 '22 00:11

Abishek Bashyal


1 Answers

This is a late answer, but the debug and even the prod signing key that you use on your local machine to create the APK won't work if you use AppBundle or Google App Signing (which is the norm now unless you opt out).

For Production apps go to Google Play Console. Click your app, click Release Management -> App Signing. Then look under App signing certificate here you can copy the SHA1 to your firebase console under Project Settings -> SHA certificate fingerprints.

This is because your upload key is swapped out on the google servers when you upload your APK / AppBundle. Meaning that your production app served to users from the play store has a different SHA1 fingerprint than anything on your local machine (including your signing keys) thats why they dont work when going live but work while debugging locally.

like image 158
Jan Avatar answered Dec 04 '22 06:12

Jan