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.
I'm out of ideas and in dire need of help. Any ideas?
API client creation in onCreate:
Actual Sign-In method:
Callback (never touched)
- 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
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();
Code:
public void signInWithGoogle() {
logToServer("Google Sign-In Started");
Intent signInIntent = Auth.GoogleSignInApi
.getSignInIntent(googleApiClient);
startActivityForResult(signInIntent,
GameConstants.GOOGLE_REQUEST_CODE_SIGN_IN);
}
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);
}
}