我正在按照本教程将google play服务添加到我的LibGDX游戏中: http://fortheloss.org/tutorial-set-up-google-services-with-libgdx/ - 在完成所有步骤后,我尝试测试游戏,但它不起作用。
在控制台中,我收到此错误:
[2016-03-16 11:55:05 - escal8-android] ------------------------------
[2016-03-16 11:55:05 - escal8-android] Android Launch!
[2016-03-16 11:55:05 - escal8-android] adb is running normally.
[2016-03-16 11:55:05 - escal8-android] Performing com.konigvanzwol.escal8.android.AndroidLauncher activity launch
[2016-03-16 11:55:05 - escal8-android] Uploading escal8-android.apk onto device '4100ad01e444a105'
[2016-03-16 11:55:08 - escal8-android] Installing escal8-android.apk...
[2016-03-16 11:55:21 - escal8-android] Success!
[2016-03-16 11:55:21 - BaseGameUtils] Could not find BaseGameUtils.apk!
[2016-03-16 11:55:21 - escal8-android] Starting activity com.konigvanzwol.escal8.android.AndroidLauncher on device 4100ad01e444a105
[2016-03-16 11:55:23 - escal8-android] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.konigvanzwol.escal8.android/.AndroidLauncher }
在 LogCat 中,我明白了:
03-16 11:00:25.965: E/AndroidRuntime(5328): FATAL EXCEPTION: main
03-16 11:00:25.965: E/AndroidRuntime(5328): Process: com.konigvanzwol.escal8.android, PID: 5328
03-16 11:00:25.965: E/AndroidRuntime(5328): java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v4/util/ArrayMap;
03-16 11:00:25.965: E/AndroidRuntime(5328): at com.google.android.gms.common.api.GoogleApiClient$Builder.<init>(Unknown Source)
03-16 11:00:25.965: E/AndroidRuntime(5328): at com.google.android.gms.common.api.GoogleApiClient$Builder.<init>(Unknown Source)
03-16 11:00:25.965: E/AndroidRuntime(5328): at com.google.example.games.basegameutils.GameHelper.createApiClientBuilder(GameHelper.java:267)
03-16 11:00:25.965: E/AndroidRuntime(5328): at com.google.example.games.basegameutils.GameHelper.setup(GameHelper.java:309)
03-16 11:00:25.965: E/AndroidRuntime(5328): at com.konigvanzwol.escal8.android.AndroidLauncher.onCreate(AndroidLauncher.java:86)
03-16 11:00:25.965: E/AndroidRuntime(5328): at android.app.Activity.performCreate(Activity.java:6374)
03-16 11:00:25.965: E/AndroidRuntime(5328): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
03-16 11:00:25.965: E/AndroidRuntime(5328): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2743)
03-16 11:00:25.965: E/AndroidRuntime(5328): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2855)
03-16 11:00:25.965: E/AndroidRuntime(5328): at android.app.ActivityThread.access$900(ActivityThread.java:181)
03-16 11:00:25.965: E/AndroidRuntime(5328): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1474)
03-16 11:00:25.965: E/AndroidRuntime(5328): at android.os.Handler.dispatchMessage(Handler.java:102)
03-16 11:00:25.965: E/AndroidRuntime(5328): at android.os.Looper.loop(Looper.java:145)
03-16 11:00:25.965: E/AndroidRuntime(5328): at android.app.ActivityThread.main(ActivityThread.java:6117)
03-16 11:00:25.965: E/AndroidRuntime(5328): at java.lang.reflect.Method.invoke(Native Method)
03-16 11:00:25.965: E/AndroidRuntime(5328): at java.lang.reflect.Method.invoke(Method.java:372)
03-16 11:00:25.965: E/AndroidRuntime(5328): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
03-16 11:00:25.965: E/AndroidRuntime(5328): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
03-16 11:00:25.965: E/AndroidRuntime(5328): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.konigvanzwol.escal8.android-2/base.apk"],nativeLibraryDirectories=[/data/app/com.konigvanzwol.escal8.android-2/lib/arm, /vendor/lib, /system/lib]]
03-16 11:00:25.965: E/AndroidRuntime(5328): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
03-16 11:00:25.965: E/AndroidRuntime(5328): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
03-16 11:00:25.965: E/AndroidRuntime(5328): at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
03-16 11:00:25.965: E/AndroidRuntime(5328): ... 18 more
03-16 11:00:25.965: E/AndroidRuntime(5328): Suppressed: java.lang.ClassNotFoundException: android.support.v4.util.ArrayMap
03-16 11:00:25.965: E/AndroidRuntime(5328): at java.lang.Class.classForName(Native Method)
03-16 11:00:25.965: E/AndroidRuntime(5328): at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
03-16 11:00:25.965: E/AndroidRuntime(5328): at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
03-16 11:00:25.965: E/AndroidRuntime(5328): at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
03-16 11:00:25.965: E/AndroidRuntime(5328): ... 19 more
我已经尝试了几乎所有我能找到的建议解决方案,包括此处建议的所有内容:Android Eclipse - Could not find *.apk ,(重新安装eclipse除外)。但到目前为止没有运气:(
我还发现了这个链接:Could not find BaseGameUtils.apk,这看起来很有帮助,但我不太明白我应该在开发者控制台中通过哪些步骤才能做到这一点。也许有人可以澄清一下?