在Android中初始化游戏客户端

编程入门 行业动态 更新时间:2024-10-10 03:23:03
本文介绍了在Android中初始化游戏客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

I'm trying the new Google Play Game Services.

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

At first I followed this howto developers.google/games/services/android/quickstart and then finished this developers.google/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 所以,我从developers.google/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 developers.google/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" />

更多推荐

在Android中初始化游戏客户端

本文发布于:2023-11-16 14:43:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1605216.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:初始化   游戏客户端   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!