0

我使用 Google Play 游戏服务中的 BaseGameUtils GameHelper 类时不时地遇到以下异常。

FATAL EXCEPTION: main
java.lang.IllegalStateException:     GameHelper: operation attempted at incorrect state. Operation: connectCurrentClient. State: DISCONNECTED. Expected state: CONNECTING.
    at com.google.example.games.basegameutils.GameHelper.assertState(GameHelper.java:184)
    at com.google.example.games.basegameutils.GameHelper.connectCurrentClient(GameHelper.java:701)
    at com.google.example.games.basegameutils.GameHelper.connectNextClient(GameHelper.java:697)
    at com.google.example.games.basegameutils.GameHelper.onConnected(GameHelper.java:777)
    at com.google.android.gms.internal.u.v(Unknown Source)
    at com.google.android.gms.internal.u$f.a(Unknown Source)
    at com.google.android.gms.internal.u$f.a(Unknown Source)
    at com.google.android.gms.internal.u$b.A(Unknown Source)
    at com.google.android.gms.internal.u$a.handleMessage(Unknown Source)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:130)
    at android.app.ActivityThread.main(ActivityThread.java:3683)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:507)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
    at dalvik.system.NativeStart.main(Native Method)

有没有人看到这个,或者知道如何绕过它或解决它?这可能是一个错误。

4

2 回答 2

1

确保清单中有这两个元数据条目:

<meta-data
    android:name="com.google.android.gms.games.APP_ID"
    android:value="@string/app_id" />
<meta-data
    android:name="com.google.android.gms.appstate.APP_ID"
    android:value="@string/app_id" />

我只有第一个,我遇到了类似的错误。希望能帮助到你。

于 2015-01-29T20:35:29.553 回答
1

是的,有一个未解决的问题: https ://github.com/playgameservices/android-samples/issues/22

于 2013-08-14T19:38:24.870 回答