-1

My app makes use of Firebase Realtime Database and Sign-In with Google authentication. In the test version of the app, everything ran smoothly. However, the sign in fails in the release version. I tried running the signingReport to get a different SHA-1, but it's the same key. I have minifiyEnabled "false" in my release version as someone suggested proguard might be interfering with some files. I have re-downloaded the google-services.json file too.

EDIT 1 I don't intend to publish the app on Google Play store. I just want to share the .apk itself with the users, could that be causing problems?

I don't know which files or code do I attach for reference.

VB Dane
  • 25
  • 6
  • did you add sha 1 key for Keystore inside your project in firebase console – Biro Nader Jul 02 '20 at 21:49
  • Yes Biro Nadar, it's the same key as before the release. Thus, the console did not update when I added the Fingerprint. – VB Dane Jul 03 '20 at 04:29
  • you need SHA-256 too – Abhinav Chauhan Jul 03 '20 at 05:33
  • @AbhinavChauhan I just updated the SHA-256 from my `signingReport` into the Firebase console. Still no luck. If I run the app from Android Studio by connecting the device, it works properly. – VB Dane Jul 03 '20 at 05:42
  • I think this **[answer](https://stackoverflow.com/questions/51360250/firebase-ui-authentication-with-google-fails-with-message-code10-message10/51360406)** might help. – Alex Mamo Jul 03 '20 at 09:05
  • @VBDane you can show a toast for the error message in the error call back, to know what is the actual problem, if the problem with sha key the message will say that this app is not authorized to use firebase authentication – Biro Nader Jul 04 '20 at 06:41

1 Answers1

0

I figured out a way to solve this, it might help a newbie like me in the future.

I was entering the SHA-1 Key of the debug version of the app and not the release version. My app's release certificate's keystore wasn't added in the signing configurations and thus my signing configuration yielded the keys for the debug version instead of the release version . Here is how to solve it.

Step 1 Generate the release version of the signed apk and store the keystore (.jks file).

Step 2 Go to Project Structures on Android Studio (Ctrl+Alt+Shift+S). On the left pane of the Project Structures window, select Modules. Click on SigningConfigs. Press on the Add Signing Config button (Alt+Insert) and enter 'release' as the name of the config.

Link the .jks file we stored before and add the information about it inn the window and save it. Sync the project with gradle files.

Step 3 Open the gradle pane and select SigningConfigs. In the gradle console, you should have multiple certificate keys. The one with the version "release" is the one you must copy and paste in your Firebase Console.

VB Dane
  • 25
  • 6