java–Google Play游戏服务中的IllegalStateException没有意义

java–Google Play游戏服务中的IllegalStateException没有意义,第1张

概述我在Play Market玩了一个游戏,然后我收到了消息和堆栈跟踪.java.lang.IllegalStateException Msg: (Not connected. Call connect() and wait for onConnected() to be called.) java.lang.IllegalStateException com

我在Play Market玩了一个游戏,然后我收到了消息和堆栈跟踪.

java.lang.IllegalStateExceptionMsg: (Not connected. Call connect() and wait for onConnected() to be called.)java.lang.IllegalStateExceptioncom.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().但正如您在stacktrace中看到的那样,调用来自onConnected().所以我确定谷歌播放服务已经连接.为什么我仍然会收到IllegalStateException?我没有意义.最佳答案有些情况下,即使正确使用API​​,androID.gms.internal也会抛出IllegalStateException.例如.下面的跟踪记录了所有客户端连接的情况,并且正在处理Google的successSignIn()回调到我们获得该异常的代码. (SwGameHelper是我们Google的GameHelper代码的副本)

请注意,gms.internal堆栈跟踪似乎包含一些名为“signOut”的方法.所以这可能是谷歌代码的一个错误,但我的猜测是连接后连接丢失的竞争条件.我不得不在其他连接服务上处理类似的比赛.如果这是一场比赛谷歌可能只需要更好地记录他们的方法可以抛出这个异常,即使你在调用它们时已连接.

我正在考虑解决这个问题的方法.如果我找到一个好的修复程序,我会更新.

这是我们最常见的安装客户崩溃错误之一,所以它并不罕见.

onConnected: connected! clIEnt=1 com.lootworks.swords.screens.SwGameHelperConnecting PlusClIEnt. com.lootworks.swords.screens.SwGameHelperonConnected: connected! clIEnt=2 com.lootworks.swords.screens.SwGameHelperAll clIEnts Now connected. Sign-in successful. com.lootworks.swords.screens.SwGameHelperAll requested clIEnts connected. Sign-in succeeded! com.lootworks.swords.screens.SwGameHelperjava.lang.IllegalStateException: Not connected. Call connect() and wait for onConnected() to be called.    at com.Google.androID.gms.internal.p.n(UnkNown Source)    at com.Google.androID.gms.internal.p.o(UnkNown Source)    at com.Google.androID.gms.internal.bj.a(UnkNown Source)                                       loadAchIEvements                                       b                                       a                                       signOut                                       a                                       a    at com.Google.androID.gms.games.GamesClIEnt.loadAchIEvements(UnkNown Source)                                             signOut    at com.lootworks.swords.social.SwAchIEvementManager.loadAndUploadAchIEvements(Sourcefile:441)    at com.lootworks.swords.activity.SwMap3D.onSignInSucceeded(Sourcefile:3526)    at com.lootworks.swords.screens.SwGameHelper.succeedSignIn(Sourcefile:639)    at com.lootworks.swords.screens.SwGameHelper.connectNextClIEnt(Sourcefile:530)    at com.lootworks.swords.screens.SwGameHelper.onConnected(Sourcefile:629)    at com.Google.androID.gms.internal.p.k(UnkNown Source)    at com.Google.androID.gms.internal.bj.k(UnkNown Source)    at com.Google.androID.gms.internal.p$f.a(UnkNown Source)    at com.Google.androID.gms.internal.p$f.a(UnkNown Source)    at com.Google.androID.gms.internal.p$b.p(UnkNown Source)    at com.Google.androID.gms.internal.p$a.handleMessage(UnkNown Source)    at androID.os.Handler.dispatchMessage(Handler.java:99)
总结

以上是内存溢出为你收集整理的java – Google Play游戏服务中的IllegalStateException没有意义全部内容,希望文章能够帮你解决java – Google Play游戏服务中的IllegalStateException没有意义所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1140271.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-31
下一篇 2022-05-31

发表评论

登录后才能评论

评论列表(0条)

保存