0

With Google Play Game Services samples, If you use a Gingerbread device that has multiple Google Accounts, you cannot sign in. GameHelper fails to sign-in and you get stuck in a never ending "sign-in screen" loop.

If you open GameHelper.java and comment out line 417: mExpectingResolution = false;

..then you can actually log in. But this also causes my game to crash.

Google Play Services and a new class GameHelper with an example ButtonClicker2000 on android 2.3 can not log in to your account. When a dialog box (sign-in dialog) appears with the user's choice, the method onStop().

/** Call this method from your Activity's onStop(). */
public void onStop() {
    debugLog("onStop");
    assertConfigured("onStop");
    if (mGoogleApiClient.isConnected()) {
        debugLog("Disconnecting client due to onStop");
        mGoogleApiClient.disconnect();
    } else {
        debugLog("Client already disconnected when we got onStop.");
    }
    mConnecting = false;
    mExpectingResolution = false;

    // let go of the Activity reference
    mActivity = null;
}

After selecting the user calls the onStart(). However, there is no sign-in. Instead Development dialog box (sign-in dialog) reappears with the user's choice. And so indefinitely.

/** Call this method from your Activity's onStart(). */
public void onStart(Activity act) {
    mActivity = act;
    mAppContext = act.getApplicationContext();

    debugLog("onStart");
    assertConfigured("onStart");

    if (mConnectOnStart) {
        if (mGoogleApiClient.isConnected()) {
            Log.w(TAG,
                    "GameHelper: client was already connected on onStart()");
        } else {
            debugLog("Connecting client.");
            mConnecting = true;
            mGoogleApiClient.connect();
        }
    } else {
        debugLog("Not attempting to connect becase mConnectOnStart=false");
        debugLog("Instead, reporting a sign-in failure.");
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                notifyListener(false);
            }
        }, 1000);
    }
}

Is there any fix for the log-in loop bug in GameHelper?

The source is here: https://github.com/playgameservices/android-basic-samples

Selzier
  • 101
  • 1
  • 6
  • 19

0 Answers0