1

Google sign in giving API exception with status code as 12500. Tried to set SHA-1 key but still giving exception.

The result in onActivityResult is coming null and showing this exception:

com.google.android.gms.auth.api.signin.GoogleSignIn.getSignedInAccountFromIntent(Unknown Source)

Is there any possible way out for this issue as I am not getting any solution.

Thanks in advance.

itsmysterybox
  • 2,748
  • 3
  • 21
  • 26
  • 3
    Possible duplicate of [Google Sign In error 12500](https://stackoverflow.com/questions/47632035/google-sign-in-error-12500) – Amit Jangid Nov 01 '18 at 04:07

2 Answers2

2

I recently resolved this issue in one of my projects and the possible reasons are below:

  • In case of google authentication, you must include your SHA1 values for your debug and release keystores on both consoles like Firebase console as well as Google developer console.
  • After completing above step download a latest google.json file fron firebase console and add that file into your project.

Your 12500 error will be resolved

Akshay Paliwal
  • 3,718
  • 2
  • 39
  • 43
  • 1
    yeah thanks I did the same way as you said and problem got resolved. The problem was that SHA-1 key generated using command line is total rubbish. But gradle signing report always generates proper SHA-1 key in gradle console. Hence, my problem solved. Thanks so much. – Sourav Adikary Nov 13 '18 at 04:12
2

I think the error came from the Wrong SHA1. Please don't forget that the SHA1 is different between release and debug mode in the android studio. Instead of using toolkey export to get the SHA1, you can use gradle project -> Task -> android -> signingReport in the android studio (can open it by menu View -> Toolwindow -> gradle ) to get release and debug SHA1. After that, for easy working, you need to create 2 separate credentials with two SHA1 on google cloud console (google just instruct to create 1 using release SHA1, when we develop it will not work since it uses the debug SHA1).

Bioz Nguyen
  • 1,842
  • 1
  • 9
  • 6