Android Google Plus 登录问题.handleSignInResult 返回 False [英] Android Google Plus sign in issue. handleSignInResult returns False

查看:33
本文介绍了Android Google Plus 登录问题.handleSignInResult 返回 False的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在集成 Google+ 登录功能时遇到了一些问题.到目前为止,我已经集成了所有必要的 G+ 登录 API 模块和代码,这些模块和代码在使用 debug.keystore 的 keytool 生成 SHA1 并将 SHA1 粘贴到谷歌云上后,生成并放置在/app 中的 google-services.json开发者控制台,但现在我只面临一个小故障,因为很多天/周,即当我尝试进行设备调试时,每当我点击G+ 登录"时,我都会在 LogCat 中收到以下错误:

<块引用>

E/GMPM:getGoogleAppId 失败,状态为:10

E/GMPM:无法上传.应用测量已停用.

D/SignInActivity:handleSignInResult:false

此 handleSignInResult 一直返回 False 并且无法登录以进一步获取数据.如果你们中有人遇到过这种情况,请在这里帮助我.这个小障碍非常令人抓狂.

谢谢大家.

解决方案

您使用的是 Plus.API 还是 Auth.GOOGLE_SIGN_IN_API?后者是最新改造的.在这里查看:https://developers.google.com/identity/sign-in/安卓/登录

<小时>

如果您使用的是 Auth.GOOGLE_SIGN_IN_API:

在onActivityResult中,使用类似下面的代码,你可以得到一个状态码,它是由GoogleSignInStatusCodes定义的:https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInStatusCodes

@Overridepublic void onActivityResult(int requestCode, int resultCode, Intent data) {super.onActivityResult(requestCode, resultCode, data);//从 GoogleSignInApi.getSignInIntent(...); 启动 Intent 返回的结果;如果(请求代码 == RC_SIGN_IN){GoogleSignInResult 结果 = Auth.GoogleSignInApi.getSignInResultFromIntent(data);int statusCode = result.getStatus().getStatusCode();}}

最常见的问题是缺少正确的 OAuth2 客户端注册.(不幸的是,目前,状态代码是 INTERNAL_ERROR 8,这没有帮助.)例如看看这个线程:当从 GoogleSignInOptions Android 请求电子邮件时发生 INTERNAL_ERROR>

I've been facing some issues while integrating Google+ Signin functionality. So far, i've integrated all the necessary G+ Sign in API modules and codes which works good, generated and placed the google-services.json within /app after generating SHA1 using keytool of debug.keystore and pasted the SHA1 on the google cloud developer console, but now there's only one glitch i am facing since many days/weeks i.e. when i try to do device debuggin and whenever i click on "G+ Sign In" i get the following error in LogCat:

E/GMPM: getGoogleAppId failed with status: 10

E/GMPM: Uploading is not possible. App measurement disabled.

D/SignInActivity: handleSignInResult:false

This handleSignInResult is returning False all the time and not able to sign in to fetch data further. If anyone of you have ever faced such situation please help me out here. This small obstacle is pretty maddening.

Thank you everyone.

解决方案

Are you using Plus.API or Auth.GOOGLE_SIGN_IN_API? The latter is the latest revamped one. Check it out here: https://developers.google.com/identity/sign-in/android/sign-in


If you are using Auth.GOOGLE_SIGN_IN_API:

In onActivityResult, use code similar to below and you can get a status code, which is defined by GoogleSignInStatusCodes: https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInStatusCodes

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...);
    if (requestCode == RC_SIGN_IN) {
        GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
        int statusCode = result.getStatus().getStatusCode();
    }
}

The most common issue is missing the right OAuth2 client registration. (Unfortunately, for now, the status code is INTERNAL_ERROR 8, which is not helpful. ) E.g. Take a look at this thread: Occured an INTERNAL_ERROR when requestEmail from GoogleSignInOptions Android

这篇关于Android Google Plus 登录问题.handleSignInResult 返回 False的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆