Skip to content

SignIn Dialog from GoogleSignInClient.getSignInIntent() not returning correct result after rotation #345

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
aaronvargas opened this issue Dec 14, 2017 · 11 comments
Labels

Comments

@aaronvargas
Copy link

When running the sample for SignInClient everything works correctly when no device rotation occurs. But if you rotate the device after showing the SignIn dialog you receive incorrect results in onActivityResult.

  • Device: Nexus 9
  • OS version: Android N
  • SDK version: 26
  • [Android] Google Play Services version: 11.6.2

Steps to reproduce:

  1. Start sample with device in portrait orientation and select SignInActitivity
  2. tap Sign In and wait for Account selector Dialog
  3. Rotate device to landscape, now select account
  4. UI doesn't update to show logout and disconnect. onActivityResult() shows correct Request code of 9001. Result code of cancelled (although account was chosen) and task has ApiException 12502 - SIGN_IN_CURRENTLY_IN_PROGRESS

I've confirmed that there are not several attempts to startActivityForResult() for the signIn attempt as the error indicates.

https://developers.google.com/android/reference/com/google/android/gms/auth/api/signin/GoogleSignInStatusCodes.html#SIGN_IN_CURRENTLY_IN_PROGRESS

@samtstern
Copy link
Contributor

@aaronvargas thanks for this report. I can confirm that is the case, I will look into it.

@samtstern
Copy link
Contributor

Hmm looks like this is a known issue (69275024 internally) I will chase it down. Thanks for the reminder!

@samtstern samtstern added the bug label Dec 15, 2017
@ghost
Copy link

ghost commented Jan 8, 2018

Has this bug been resolved?

@samtstern
Copy link
Contributor

@vinaysshenoyhl no it has not yet been resolved, I will try and get an update on this issue.

@ghost
Copy link

ghost commented Jan 8, 2018

Awesome, thanks! I'm not in any particular hurry to see it resolved since it's not blocking us on anything, just wanted to confirm that the issue is still open and the error wasn't due to anything I was doing wrong.

@SUPERCILEX
Copy link

@samtstern I just encountered this issue myself and thought I'd broken stuff in my refactor! 😱 Hope this gets fixed soon, for now, I've added a hack.

@samtstern
Copy link
Contributor

This should be fixed in the next release of play services (whatever comes after 12.0.0)

@awenger
Copy link

awenger commented Jan 10, 2019

@samtstern we are still getting this error with version 16.0.1.
We see a SIGN_IN_CURRENTLY_IN_PROGRESS (12502) with a SIGN_IN_CANCELLED (12501) shortly after.

@Dina07
Copy link

Dina07 commented Apr 19, 2019

android.content.Intent com.google.android.gms.auth.api.signin.GoogleSignInClient.getSignInIntent()' on a null object reference

explain please

@sekarpdkt
Copy link

Is it resolved? I am having same issue now too. As an workaround, I did following handling


            if( e.getStatusCode()==12502){
                /*
                * https://github.com/googlesamples/google-services/issues/345
                */
                GoogleSignInAccount accountOld = GoogleSignIn.getLastSignedInAccount(activity.getApplicationContext());
                if (accountOld != null) {
                    LOG.info("Got cached sign-in");
                    handleSignedInAccount(accountOld);
                }   
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants
@sekarpdkt @awenger @aaronvargas @samtstern @SUPERCILEX @Dina07 and others