0

When I compile the app from android studio the signin works. I generate the signed apk but it doesn't work and says login error.

The error that give after is: You have wrong OAuth2 related configurations, please check. Detailed error: UNREGISTERED_ON_API_CONSOLE.

I am using Google Signin Auth.

Which showed when I was not able to configure before and after it shows again. Can someone help me?

1 Answers1

0

You may check this thread. It stated that when you sign an APK and then ask Google for a OAuth2 token, you have to register your signed app through the dev console. It's a security measure based on the app package name and the sha1 fingerprint.

To do that, you have to:

  1. sign your APK, manually or through Gradle or whatever: the Android documentation is pretty clear on this step;
  2. get your sha1 fingerprint; as mention in this SO answer, it's kind of easy on Android Studio: in the Gradle panel, select the signingReport task under your root project and run it - the SHA1 fingerprint will show in the text output;
  3. register your APK through the Google dev console: create a new Credentials / OAuth client id / Android, defined by the SHA1 fingerprint you got and your APK package name.

Additional reference which might help: Google sign in failed after frequent signing in and out

abielita
  • 13,147
  • 2
  • 17
  • 59
  • I was able to solve it but even after loging in it doesnt change the highscore of the leaderboard when generating the signed apk the user after obtains the score but it doesn't change . Do you know what might be the problem? – anish ghimire Jun 07 '17 at 11:43