Google sign in(OAuth) does not work when the apk is from Firebase App Distribution

Viewed 427

I have built a simple Google Sign in for my application. However, when I deploy the apk using Firebase App Distribution, the process returns error code 10 when a user is trying to do google sign in on their device. I have checked to make sure that the firebase project has the same SHA-1 key as my application. I am also using github actions to deploy the apk(debug) to Firebase. I'm not really sure which code snippet to show here because I am following the Google Docs on integrating Sign in. This works on the emulator. You can let me know if there's any particular file I should add here for you to help better

2 Answers

In Credentials select your Android project. Your API key by default has name "Android key (auto created by Firebase)". Then click "Edit API key" and in field "API restrictions" select "Don't restrict key" and click "Save". Now Google Sign in (OAuth) should works properly also when the apk is from Firebase App Distribution.

In case of AAB:

  1. Open Firebase console -> Your project -> (All products) -> App Distribution
  2. On "Releases" tab press "View certificate" button
  3. Copy SHA-1 fingerprint
  4. Go to Project settings
  5. For Android app add copied SHA-1 fingerprint

App distribution generates a new test certificate after your first AAB upload, so you should add it for your application.

Related