Apps Infinite Loop in Google Login

Wollo77

Lurker
My app has been live using Google login for a few years now. I reworked the implementation a few months ago with no issues until recently. Now, a few weeks ago, login has stopped working. When I attempt it, the login never finishes, but stays in an infinite loop, displaying the "connecting" screen over and over.

  • internet connectivity is ok
  • this happens to many users (not sure if it affects ALL Google login users)
  • I have tried clearing the cache of Google Play services
  • the Google API client is still connected
  • I have tried updating all relevant google libraries to the most recent versions
  • I see this on Android 6 - not sure if other versions are affected
Before I post my code, I want to point out that the login never returns. The callback is never reached until I actively cancel the login (at which point it behaves as expected. I also want to emphasise again that my code has been in place for quite some time before this occurred - maybe something changed on Google side...

I'm out of ideas and in dire need of help. Any ideas?

API client creation in onCreate:
Code:
GoogleSignInOptions googleSignInOptions = googleSignInOptionsBuilder
       .build();

googleApiClient = new GoogleApiClient.Builder(this)
       .enableAutoManage(this,
               new GoogleApiClient.OnConnectionFailedListener() {
                   @Override
                   public void onConnectionFailed(
                           @NonNull ConnectionResult connectionResult) {
                       Logger.error("Google API connection failed");
                   }
               })
       .addApi(Auth.GOOGLE_SIGN_IN_API, googleSignInOptions)
       .addApi(Games.API)
       .build();
Actual Sign-In method:
Code:
public void signInWithGoogle() {
   logToServer("Google Sign-In Started");
   Intent signInIntent = Auth.GoogleSignInApi
           .getSignInIntent(googleApiClient);
   startActivityForResult(signInIntent,
           GameConstants.GOOGLE_REQUEST_CODE_SIGN_IN);
}
Callback (never touched)
Code:
@Override
protected void onActivityResult(final int requestCode, int response,
       Intent data) {
   super.onActivityResult(requestCode, response, data);

   if (requestCode == GameConstants.GOOGLE_REQUEST_CODE_SIGN_IN) {
       GoogleSignInResult result = Auth.GoogleSignInApi
               .getSignInResultFromIntent(data);
       handleGoogleSignInResult(result);
   }
}
 
D

Deleted User

Guest
Another thing to check is the error log. Anything unusual reported there?
 

Wollo77

Lurker
Thread starter
Another thing to check is the error log. Anything unusual reported there?
I checked, but it's not giving any errors. I have not checked for debug output from outside the app (i.e. google play services), that may be worth a try.
 
D

Deleted User

Guest
Yes, that is my question, and it's only 3 days old, not years. ;)

Lol! That'll teach me to read questions properly.

Another avenue to explore would be to trace the Google login Activity. Code should be available to set breakpoints in, and try to figure out what it's doing.
 
Top