Android - GoogleSignInResult always failing

帅比萌擦擦* 提交于 2019-12-19 17:39:23

问题


I have followed the tutorial here: https://developers.google.com/identity/sign-in/android/start-integrating to integrate Google sign in into my app.

However, the GoogleSignInResult.isSuccess() is always false. GoogleSignInStatusCodes.getStatusCodeString(googleSignInResult.getStatus().getStatusCode()) shows INTERNAL_ERROR. The docs here say "retrying should solve the problem", but it doesn't.

Any ideas on what's wrong?

Similar question here, but I have added the json file.


回答1:


The problem was that I was running the app from Android Studio (without setting up signingConfig), so the app wasn't signed with my certificate, which Google Sign-in requires.




回答2:


If you run from Android studio without signingConfigs, then it is using your debug key store to sign. You can try register your package name + debug key SHA1 in dev console for easy development:

Test google signin on Android in development phase



来源:https://stackoverflow.com/questions/34652682/android-googlesigninresult-always-failing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!