1

我只是想让安卓的谷歌游戏服务在我的手机上运行,​​但我遇到了一些问题。我对 android 开发非常陌生,所以如果这是一个浪费或解释不清的问题,我深表歉意。谢谢。

我正在使用以下两个库: google-play-services_lib

BaseGameUtils

我的代码编译正常,只有一个表面警告(如下)。当我尝试在我的 android 2.36 上运行它(编辑:我无法访问任何其他测试设备)时,它会在屏幕上闪烁片刻,然后要求强制关闭。

如果我调试它,我会看到以下屏幕:第一行显示“此类文件的 JAR 属于容器'Android Private Libraries',它不允许修改其条目上的源附件调试屏幕

当前警告是:从未使用过 import com.google.android.gms.common.ConnectionResult BaseGameActivity.java /BaseGameUtils/src/com/google/example/games/basegameutils

我必须将库和主项目的构建路径都设置为 4.2,以便 BuildGameUtils 可以正常编译(不太确定仅此一项是否应该将我的设备排除在运行之外)

我基本上只是在遵循以下教程:https ://developers.google.com/games/services/android/init

另外,我的 logcat 如下所示:

08-14 02:23:41.569: W/ActivityThread(8641): Application com.example.gggg is waiting for the debugger on port 8100...
08-14 02:23:41.579: I/System.out(8641): Sending WAIT chunk
08-14 02:23:41.779: I/System.out(8641): Debugger has connected
08-14 02:23:41.779: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:41.989: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:42.179: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:42.389: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:42.589: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:42.789: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:42.989: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:43.189: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:43.399: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:43.599: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:43.789: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:43.999: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:44.189: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:44.399: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:44.599: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:44.789: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:44.999: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:45.199: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:45.399: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:45.599: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:45.809: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:46.009: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:46.209: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:46.399: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:46.609: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:46.809: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:46.999: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:47.209: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:47.409: I/System.out(8641): waiting for debugger to settle...
08-14 02:23:47.609: I/System.out(8641): debugger has settled (1425)
08-14 02:23:47.749: W/dalvikvm(8641): Link of class 'Lcom/google/android/gms/internal/bv$b;' failed
08-14 02:23:47.749: E/dalvikvm(8641): Could not find class 'com.google.android.gms.internal.bv$b', referenced from method com.google.android.gms.internal.bv.a
08-14 02:23:47.749: W/dalvikvm(8641): VFY: unable to resolve new-instance 740 (Lcom/google/android/gms/internal/bv$b;) in Lcom/google/android/gms/internal/bv;
08-14 02:23:47.799: W/dalvikvm(8641): VFY: unable to resolve instance field 25
08-14 02:23:48.289: W/dalvikvm(8641): VFY: unable to resolve direct method 3636: Landroid/os/RemoteException;.<init> (Ljava/lang/String;)V

谢谢

4

1 回答 1

0

确保您的 google 服务 ID 也在您的 XML 文件中正确设置。

<meta-data  android:name="com.google.android.gms.games.APP_ID" android:value="YOUR GOOGLE SERVICES ID"/>

该 ID 在 Google Developer Console -> Game Services 上获得。


还要确保您的包名称在两个地方都相同:
-您的 android 应用程序的清单 XML 文件。

<manifest   xmlns:android="http://schemas.android.com/apk/res/android" package="com.YOUR.PACKAGE.NAME" android:versionCode="1" android:versionName="1.0">


-Google 开发者控制台 -> 游戏服务端。


您应该知道的更多事情:
- 在您的 Android 设备上使用的主要 google 帐户也必须列在 Google Developer Console -> 设置 -> 许可测试中(在您发布 APK 之前)。如果该帐户未列出,则在游戏发布之前,您将无法访问应用程序内的服务。

希望能帮助到你,

弗拉基米尔

于 2013-08-20T11:37:16.347 回答