Flutter/Firebase Google login not working after building apk file

旧城冷巷雨未停 提交于 2020-07-07 12:01:13

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/57840495/flutter-firebase-google-login-not-working-after-building-apk-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!