且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android Google Plus登录问题。 handleSignInResult返回False

更新时间:2023-12-04 23:21:04

您是否使用Plus.API或Auth.GOOGLE_SIGN_IN_API?后者是最新改版的。点击此处查看:
https://developers.google .com / identity /登录/ android /登录






如果您使用的是Auth。 GOOGLE_SIGN_IN_API:

在onActivityResult中,使用类似于下面的代码,您可以获得状态代码,该代码由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);

//从GoogleSignInApi.getSignInIntent(...)启动Intent返回的结果;
if(requestCode == RC_SIGN_IN){
GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
int statusCode = result.getStatus()。getStatusCode();


最常见的问题是缺少正确的OAuth2客户端注册。 (不幸的是,现在,状态代码是INTERNAL_ERROR 8,这是没有用的。)看看这个线程:
发生了INTERNAL_ERROR当来自GoogleSignInOptions Android的requestEmail

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