简体   繁体   中英

Exception com.google.android.gms.common.api.ApiException: 12500

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.

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).

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM