我正在使用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)
有没有人看过这个,或者知道如何绕过它或解决它?这可能是一个错误。
答案 0 :(得分:1)
答案 1 :(得分: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" />
我只有第一个,我得到了类似的错误。 希望它有所帮助。