在Android中初始化游戏客户端初始化、游戏客户端、Android

2023-09-12 04:13:46 作者:你愛我愛你。

我尝试新的谷歌玩游戏服务。

I'm trying the new Google Play Game Services.

起初,我跟着这个HOWTO https://developers.google.com/games/services/android/quickstart 然后完成这个https://developers.google.com/games/services/android/init

At first I followed this howto https://developers.google.com/games/services/android/quickstart and then finished this https://developers.google.com/games/services/android/init

我最终是这样的:

05-16 20:01:39.034: E/AndroidRuntime(18257): FATAL EXCEPTION: main
05-16 20:01:39.034: E/AndroidRuntime(18257): java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
05-16 20:01:39.034: E/AndroidRuntime(18257):    at com.google.android.gms.internal.p$f.a(Unknown Source)
05-16 20:01:39.034: E/AndroidRuntime(18257):    at com.google.android.gms.internal.p$f.a(Unknown Source)
05-16 20:01:39.034: E/AndroidRuntime(18257):    at com.google.android.gms.internal.p$b.p(Unknown Source)
05-16 20:01:39.034: E/AndroidRuntime(18257):    at com.google.android.gms.internal.p$a.handleMessage(Unknown Source)
05-16 20:01:39.034: E/AndroidRuntime(18257):    at android.os.Handler.dispatchMessage(Handler.java:99)
05-16 20:01:39.034: E/AndroidRuntime(18257):    at android.os.Looper.loop(Looper.java:137)
05-16 20:01:39.034: E/AndroidRuntime(18257):    at android.app.ActivityThread.main(ActivityThread.java:5041)
05-16 20:01:39.034: E/AndroidRuntime(18257):    at java.lang.reflect.Method.invokeNative(Native Method)
05-16 20:01:39.034: E/AndroidRuntime(18257):    at java.lang.reflect.Method.invoke(Method.java:511)
05-16 20:01:39.034: E/AndroidRuntime(18257):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
05-16 20:01:39.034: E/AndroidRuntime(18257):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
05-16 20:01:39.034: E/AndroidRuntime(18257):    at dalvik.system.NativeStart.main(Native Method)

我试着遵循一步的教程一步。我不明白是怎么回事错了。

I've tried to follow the tutorial step by step. I don't understand what is going wrong.

ava.lang.IllegalStateException:发生致命开发商错误。检查日志以获取更多信息。

ava.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.

我觉得logcat的=日志,并没有什么。所以,我在哪里可以找到这些记录?

I thought that logcat = logs and there is nothing more. So where can I find these "logs"?

我的实现是不同的只有一件事。我有一个ClassA的延伸BaseGameActivity然后ClassB的延伸ClassA和实现View.OnClickListener 所以,我从https://developers.google.com/games/services/android/init类ClassB的

My implementation is different only in one thing. I have a ClassA which extends BaseGameActivity and then ClassB which extends ClassA and implements View.OnClickListener So I have all methods from https://developers.google.com/games/services/android/init in class ClassB

感谢您的帮助

推荐答案

我有同样的问题开始。我所要做的就是看全,未经过滤的LogCat中的日志。在那里,我看到的消息:

I had the same problem initially. What I had to do was look at the full, unfiltered LogCat log. There, I saw the message:

GamesIntentService(17929):使用谷歌玩游戏服务,需要在应用标签的元数据标签名称为com.google.android.gms.games.APP_ID你的清单

GamesIntentService(17929): Using Google Play games services requires a metadata tag with the name "com.google.android.gms.games.APP_ID" in the application tag of your manifest

因此​​,假设您创建了一个条目的的strings.xml 名为 APP_ID ,尝试添加以下到您的的Andr​​oidManifest.xml <应用> 标签:

So, assuming you created an entry in your strings.xml called app_id, try adding the following to your AndroidManifest.xml under the <application> tag:

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