简体   繁体   English

更新LibGDX后Android崩溃

[英]Android Crashes After Updating LibGDX

I'm trying to update to the latest LibGDX version 1.9.2 (I've been using an old version for quite a while) but after creating a new LibGDX project and running the default badlogic logo application it crashes on Android. 我正在尝试更新为最新的LibGDX版本1.9.2(我使用旧版本已经有一段时间了),但是在创建新的LibGDX项目并运行默认的badlogic徽标应用程序后,它在Android上崩溃了。 I've created new LibGDX projects plenty of times with no problems, so something must be different now because it's not working this time. 我已经多次创建新的LibGDX项目,没有任何问题,因此现在必须有所不同,因为这次无法正常工作。 There are no errors in my project and the desktop project works fine, it just simply crashes when I try to run the Android project. 我的项目中没有错误,并且桌面项目运行正常,当我尝试运行Android项目时,它只是崩溃了。

I created a new LibGDX project using the setup application and then went through the Eclipse setup process that I normally go through which has always worked before: 我使用设置应用程序创建了一个新的LibGDX项目,然后经历了我通常会经历的Eclipse安装过程:

  • Setup desktop run configuration to point the assets folder to the Android assets folder 设置桌面运行配置以将资产文件夹指向Android资产文件夹
  • Configure Android build path, I've tried using both Android 4.4 (API 20) and Android 6.0 (API 23) 配置Android构建路径,我尝试同时使用Android 4.4(API 20)和Android 6.0(API 23)
  • Setup Android run configuration to use my Android project and launch on active devices 设置Android运行配置以使用我的Android项目并在活动设备上启动

I've also tried using the SDK Manager to update the Android SDK's I have installed, re-downloading the LibGDX setup just in case it had gotten corrupted somehow, and deleting/re-creating the project several times but it still doesn't work. 我还尝试使用SDK Manager更新我已安装的Android SDK,以防万一它损坏的情况下重新下载LibGDX设置,并多次删除/重新创建该项目,但仍然无法正常工作。

I've also tried googling the error message but most of what I found seems unrelated to LibGDX. 我也尝试过搜索错误消息,但是我发现的大多数内容似乎与LibGDX无关。 Some of the fixes I found were settings issues that are already set correctly in my project. 我发现的一些修复是项目中已经正确设置的设置问题。 So I'm kind of at a loss here and not sure what the problem is. 所以我有点茫然,不知道问题出在哪里。

Here is the error message: 这是错误消息:

04-26 00:59:31.724: E/AndroidRuntime(1641): FATAL EXCEPTION: main
04-26 00:59:31.724: E/AndroidRuntime(1641): Process: com.tekker.metronome, PID: 1641
04-26 00:59:31.724: E/AndroidRuntime(1641): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.tekker.metronome/com.tekker.metronome.AndroidLauncher}: java.lang.ClassNotFoundException: Didn't find class "com.tekker.metronome.AndroidLauncher" on path: DexPathList[[zip file "/data/app/com.tekker.metronome-1/base.apk"],nativeLibraryDirectories=[/data/app/com.tekker.metronome-1/lib/arm64, /vendor/lib64, /system/lib64]]
04-26 00:59:31.724: E/AndroidRuntime(1641):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2988)
04-26 00:59:31.724: E/AndroidRuntime(1641):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3242)
04-26 00:59:31.724: E/AndroidRuntime(1641):     at android.app.ActivityThread.access$1000(ActivityThread.java:205)
04-26 00:59:31.724: E/AndroidRuntime(1641):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1695)
04-26 00:59:31.724: E/AndroidRuntime(1641):     at android.os.Handler.dispatchMessage(Handler.java:102)
04-26 00:59:31.724: E/AndroidRuntime(1641):     at android.os.Looper.loop(Looper.java:145)
04-26 00:59:31.724: E/AndroidRuntime(1641):     at android.app.ActivityThread.main(ActivityThread.java:6895)
04-26 00:59:31.724: E/AndroidRuntime(1641):     at java.lang.reflect.Method.invoke(Native Method)
04-26 00:59:31.724: E/AndroidRuntime(1641):     at java.lang.reflect.Method.invoke(Method.java:372)
04-26 00:59:31.724: E/AndroidRuntime(1641):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
04-26 00:59:31.724: E/AndroidRuntime(1641):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
04-26 00:59:31.724: E/AndroidRuntime(1641): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.tekker.metronome.AndroidLauncher" on path: DexPathList[[zip file "/data/app/com.tekker.metronome-1/base.apk"],nativeLibraryDirectories=[/data/app/com.tekker.metronome-1/lib/arm64, /vendor/lib64, /system/lib64]]
04-26 00:59:31.724: E/AndroidRuntime(1641):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
04-26 00:59:31.724: E/AndroidRuntime(1641):     at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-26 00:59:31.724: E/AndroidRuntime(1641):     at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
04-26 00:59:31.724: E/AndroidRuntime(1641):     at android.app.Instrumentation.newActivity(Instrumentation.java:1080)
04-26 00:59:31.724: E/AndroidRuntime(1641):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2978)
04-26 00:59:31.724: E/AndroidRuntime(1641):     ... 10 more
04-26 00:59:31.724: E/AndroidRuntime(1641):     Suppressed: java.lang.NoClassDefFoundError: com.tekker.metronome.AndroidLauncher
04-26 00:59:31.724: E/AndroidRuntime(1641):         at dalvik.system.DexFile.defineClassNative(Native Method)
04-26 00:59:31.724: E/AndroidRuntime(1641):         at dalvik.system.DexFile.defineClass(DexFile.java:226)
04-26 00:59:31.724: E/AndroidRuntime(1641):         at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
04-26 00:59:31.724: E/AndroidRuntime(1641):         at dalvik.system.DexPathList.findClass(DexPathList.java:321)
04-26 00:59:31.724: E/AndroidRuntime(1641):         at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
04-26 00:59:31.724: E/AndroidRuntime(1641):         ... 14 more
04-26 00:59:31.724: E/AndroidRuntime(1641):     Suppressed: java.lang.ClassNotFoundException: com.tekker.metronome.AndroidLauncher
04-26 00:59:31.724: E/AndroidRuntime(1641):         at java.lang.Class.classForName(Native Method)
04-26 00:59:31.724: E/AndroidRuntime(1641):         at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
04-26 00:59:31.724: E/AndroidRuntime(1641):         at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
04-26 00:59:31.724: E/AndroidRuntime(1641):         at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
04-26 00:59:31.724: E/AndroidRuntime(1641):         ... 13 more
04-26 00:59:31.724: E/AndroidRuntime(1641):     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

I ended up biting the bullet and installing Android Studio and the new version of LibGDX works fine with that. 最后,我忍不住要安装Android Studio,新版本的LibGDX可以正常工作。 So I guess it's time to retire the outdated Eclipse + ADT plugin. 因此,我想是时候淘汰过时的Eclipse + ADT插件了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM