我在 Play Market 中有一个游戏,我收到了消息和堆栈跟踪。
java.lang.IllegalStateException
Msg: (Not connected. Call connect() and wait for onConnected() to be called.)
java.lang.IllegalStateException
com.google.android.gms.internal.p.n(Unknown Source)
com.google.android.gms.internal.p.o(Unknown Source)
com.google.android.gms.internal.e.loadState(Unknown Source)
com.google.android.gms.appstate.AppStateClient.loadState(Unknown Source)
com.peerkesoftware.blockcrusher.CloudSave.load(CloudSave.java:31)
com.peerkesoftware.blockcrusher.CloudSave.setAppStateClient(CloudSave.java:26)
com.peerkesoftware.blockcrusher.MorburActivity.onSignInSucceeded(MorburActivity.java:475)
com.peerkesoftware.libgeneric.app.game.GameHelper.succeedSignIn(GameHelper.java:652)
com.peerkesoftware.libgeneric.app.game.GameHelper.connectNextClient(GameHelper.java:539)
com.peerkesoftware.libgeneric.app.game.GameHelper.onConnected(GameHelper.java:642)
com.google.android.gms.internal.p.k(Unknown Source)
com.google.android.gms.internal.bj.k(Unknown Source)
com.google.android.gms.internal.p$f.a(Unknown Source)
com.google.android.gms.internal.p$f.a(Unknown Source)
com.google.android.gms.internal.p$b.p(Unknown Source)
com.google.android.gms.internal.p$a.handleMessage(Unknown Source)
android.os.Handler.dispatchMessage(Handler.java:99)
android.os.Looper.loop(Looper.java:132)
android.app.ActivityThread.main(ActivityThread.java:4126)
java.lang.reflect.Method.invokeNative(Native Method)
java.lang.reflect.Method.invoke(Method.java:491)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:844)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
dalvik.system.NativeStart.main(Native Method)
奇怪的是消息说我应该调用 connect() 并等待 onConnected()。但正如您在堆栈跟踪中看到的那样,调用来自 onConnected()。所以我确定 Google Play 服务已连接。为什么我仍然会收到 IllegalStateException?我没有道理。