5

I'm running into trouble signing into my Android app after I released it to the Play Store (internal and closed testing releases). Basically, my sign-in options (email & third party) do not work. Firebase is connected, because I can properly create accounts and write to Firestore via the app. If I have an error (wrong password, wrong email, etc), Firebase will kick that error back to me. However, a “successful” login simply does not result in a finished sign in process, and my app is stuck on that await method forever.

I have no problems when running on an emulator, running on Android devices straight from Flutter (both release and debug modes), or running on iOS in any capacity.

What is going on here? I don't think it's my actual code, and I must be missing a step as part of the Android release process. I have permissions requested for internet and access network state, the SHA keys should all be good to go for Firebase (added debug, release, and Play Store keys) and my firebase dependencies are the most up to date.

nickinspace
  • 113
  • 2
  • 9
  • Try this out [link](https://stackoverflow.com/questions/65358177/google-signin-not-working-in-production/65358269#65358269). If this work let me know ill post that as answer so you can approve that. – ahmad bajwa Dec 21 '20 at 17:20
  • 1
    It doesn't work. I have that added to Firebase, and I replaced the google-services.json file afterwards. – nickinspace Dec 21 '20 at 17:40
  • No change it from google console not from firebase. – ahmad bajwa Dec 21 '20 at 17:42
  • 1
    ok, I definitely have. I have 3 keys in (and 3 OAuth Clients) that correspond to debug, release, and the weird Google Play key for release as well. – nickinspace Dec 21 '20 at 18:18
  • 1
    Does anyone know if I need SHA 256 key maybe? – nickinspace Dec 21 '20 at 22:30
  • @nickinspace no i think you don't need of SHA 256, Have you added play console SHA key into your firebase console ? – Shubham Narkhede Dec 22 '20 at 05:23
  • I have. I've been digging through forums all day, I'm wondering if maybe the lack of an OAuth Consent Screen is causing this? Currently in the verification process just in case... – nickinspace Dec 22 '20 at 05:28
  • My app just loads forever, I don't even get to an OAuth Consent screen lol. So there is something hung up when I try to login via Firebase Auth, because I don't get a true error back from Firebase either. – nickinspace Dec 23 '20 at 07:48

4 Answers4

6

When the application is uploaded to Google Play, a new SHA1 code is generated

All you have to do is copy the new code and add it to the Firebase project.

when you signed your APK with SHA-1 and upload the APK it only signed by you but as per the new update it is also signed by Google Play for more security.

You can check this.

Adel B-Lahlouh
  • 1,059
  • 1
  • 8
  • 20
  • 2
    I have done this. I have 3 SHA-1 keys in Firebase associated with my Android app. 1 is my original debug key, 1 is the release key from the keystone on my computer, and 1 is that key from Google Play. A new google-services json was generated and added to my project, but the same issue exists. – nickinspace Dec 22 '20 at 17:44
  • This fixed the issue after being stuck for several days, big thanks. App SHA-1 in Play Console is under: Release > Setup > App integrity – Gene Bo Nov 11 '21 at 23:14
2

It wasn't an SHA-1 issue. It had something to do with shrinking code during build. See https://stackoverflow.com/a/65511857/14834849

nickinspace
  • 113
  • 2
  • 9
0

I Solved the issue by

-> adding all SHA-1 keys for debug and release and google play (if you released to the play store and let it manage signing the app) to my firebase console Project setting > general > app > SHA certificate fingerprints

after that

-> download a fresh google-services.json file and replace it with the old one in your project if have any

0

Update SHA-1 Key in Firebase project setting

enter image description here

Also check your google cloud project api key setting and also add SHA-1 Key credentials if you have Key restrictions.

enter image description here

Tushar Rai
  • 2,371
  • 4
  • 28
  • 57