0

I'm working on an Android (Kotlin) application, and have published it to the Internal Track on Google Play.

The problem I have is being to sign into the application via Google, using Firebase SDK when the application is installed on a physical device through the Google Play Store. Everything works fine when when running in the emulator, or a debug build is installed onto a device via Android Studio.

Not sure if relevant, but when I build the bundle, I'm using the gradle command ./gradlew bundleRelease and pushing it to Google via the r0adkll/upload-google-play@v1 GitHub action.

I've followed standard procedures for setting up Firebase with multiple SHA keys in my Firebase project settings:

  • SHA-1 key for my local Android debug keystore.
  • SHA-1 key for the App Signing key from Google Play Console.
  • SHA-1 key for the Upload key from Google Play Console. (Not sure if needed?)
  • SHA-1 key for the internal app key from Google Play Console.

I've checked these many times over making sure they're the latest and correct. I've also regenerated the google-services.json file.

I'm also not receiving any reports or data from Firebase Crashlytics which I don't know if is related or not?

I'm unsure where else to look or what other debugging steps I should take. Are there other areas or settings that could potentially cause this problem? I'm very aware of the other SO posts similar to this, but they all seem to be solved due to a typo or missed SHA-1 in Firebase.

Chris
  • 3,437
  • 6
  • 40
  • 73
  • Maybe this [answer](https://stackoverflow.com/a/51360406/5246885) will help. – Alex Mamo Jul 26 '23 at 07:44
  • Unfortunately it does not. – Chris Jul 28 '23 at 16:05
  • Brother, what happens in the log, Can you please provide that? – RmTomal Jul 29 '23 at 11:52
  • I actually don't know how to get the logs from an app released through Google as I can't mark it as debuggable since Google won't allow it to b e uploaded, even to internal test tracks. If I could access the logs I'm sure I could figure all this out. Any tips? – Chris Jul 29 '23 at 14:46
  • The bounty attracted ***several*** [ChatGPT](https://meta.stackoverflow.com/questions/421831/temporary-policy-chatgpt-is-banned) plagiarisers. – Peter Mortensen Aug 04 '23 at 12:15

3 Answers3

0

The problem was with Proguard/R8 and how it handles minifying the Firebase SDK. This was resolved in an update a week or so ago (Issue had been open since 2020)

Fixed an issue with Proguard rules when R8 full-mode obfuscation is enabled https://firebase.google.com/support/release-notes/android

The GitHub issue which lead me to the release notes: https://github.com/firebase/firebase-android-sdk/issues/2124

Chris
  • 3,437
  • 6
  • 40
  • 73
-2

Try to check this:

  1. If you are not receiving crashlytics then you have problems with integration. At first, check integration (build.gradle of the project module, build.gradle of the app module). There must be correct plugins and dependencies. Second, force the crash. Just call throw RuntimeException("Test exception!"). It will activate a connection between your app and Firebase

  2. What is in your Firebase account? Sometimes Firebase forces you to make custom settings. I had experience where I needed to go to GCP and create credentials for my Firebase project. It helped to me, and you can check it here.

  3. What is in your logs? You don't need logs from your app. You need logs from Firebase. So, you should try to connect the phone via USB, go to LogCat in Android Studio and start the application. Then in the ocean of log messages, you should find Firebase-related messages. You need about 10 seconds of logs to determine the problem.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
hi.cosmonaut
  • 120
  • 1
  • 9
-4

It seems like you have already taken the necessary steps to set up Firebase Authentication with the correct SHA-1 keys. Since the authentication works fine in the emulator and debug builds but fails on physical devices installed from the Google Play Store, there might be a few potential reasons for this issue:

  1. ProGuard/R8 Obfuscation: When you build a release version of your app, ProGuard or R8 obfuscation is often enabled by default. This process can sometimes cause issues with Firebase Authentication and other libraries that rely on reflection or dynamic class loading. Make sure you properly configure ProGuard/R8 to keep the necessary Firebase classes and methods intact.

  2. Google Play Services: Ensure that the devices on which the app is installed have up-to-date Google Play services. Firebase Authentication and other Firebase services require the latest version of Google Play services to function correctly. Users should have the Play services updated on their devices.

  3. Check for Error Logs: In cases where authentication fails, Firebase usually provides useful error messages. Check for any error logs or exceptions related to Firebase Authentication in your logs or use Firebase Crashlytics to track any potential errors.

  4. Internet Connection: Firebase Authentication requires an internet connection to work. Make sure the device has a stable internet connection when trying to authenticate.

  5. ProGuard Rules for Crashlytics: If you are not receiving any reports or data from Firebase Crashlytics, it might be related to ProGuard/R8 configuration. Ensure that you have the necessary ProGuard rules for Crashlytics set up correctly. Firebase Crashlytics can get affected by ProGuard/R8 obfuscation if the rules are not set up properly.

  6. Check SHA-1 Keys: Double-check that the SHA-1 keys you have entered in the Firebase project settings match the SHA-1 keys of the actual release keystore used for signing the app bundle that you uploaded to the Google Play Console.

  7. Test on Multiple Devices: Test the app on multiple physical devices to rule out device-specific issues. Sometimes, certain devices might have specific configurations that can cause problems with Firebase Authentication.

If none of the above steps resolve the issue, it might be helpful to check the Firebase documentation and official support channels for any known issues or updates related to Firebase Authentication. Additionally, you can also try reaching out to Firebase support for further assistance with the specific issue you are facing.

Rasheeda
  • 6
  • 3