Google 登录过程中的ApiException报错问题

在App上接google账号登录的过程中遇到如下报错:

Exception com.google.android.gms.common.api.ApiException: 12500: 
 at com.google.android.gms.common.internal.zzb.zzz(Unknown Source)
 at com.google.android.gms.auth.api.signin.GoogleSignIn.getSignedInAccountFromIntent(Unknown Source)
 at com.ewise.android.api.MainActivity.onActivityResult(SignInActivity.java:89)     at android.app.Activity.dispatchActivityResult(Activity.java:7010)
 at android.app.ActivityThread.deliverResults(ActivityThread.java:4187)
 at android.app.ActivityThread.handleSendResult(ActivityThread.java:4234)
 at android.app.ActivityThread.-wrap20(ActivityThread.java)
 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1584)
 at android.os.Handler.dispatchMessage(Handler.java:102)
 at android.os.Looper.loop(Looper.java:154)
 at android.app.ActivityThread.main(ActivityThread.java:6316)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)

解决办法:
在firebase上对自己的应用进行如下配置,如图所示:

firebase上对应用进行配置.png

1.设置support email;
2.设置SHA-1的指纹秘钥(至于SHA-1怎么生成的网上一大堆)
3.保证自己应用里面的google-serices.json文件要是firebase上面最新下载下来的
参考链接:https://stackoverflow.com/questions/47632035/google-sign-in-error-12500

你可能感兴趣的:(Google 登录过程中的ApiException报错问题)