LibGDX And​​roid应用程序在启动时崩溃

时间:2016-03-31 20:42:58

标签: java android eclipse libgdx

当我运行我的项目时,它会立即崩溃并输出。我创建了一个新的项目,但它也崩溃了。我正在使用Eclipse,因为我非常喜欢它。

03-31 22:26:35.896: E/AndroidRuntime(17299): FATAL EXCEPTION: main
03-31 22:26:35.896: E/AndroidRuntime(17299): Process: se.wiklund.memblock, PID: 17299
03-31 22:26:35.896: E/AndroidRuntime(17299): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{se.wiklund.memblock/se.wiklund.memblock.AndroidLauncher}: java.lang.ClassNotFoundException: Didn't find class "se.wiklund.memblock.AndroidLauncher" on path: DexPathList[[zip file "/data/app/se.wiklund.memblock-1/base.apk"],nativeLibraryDirectories=[/data/app/se.wiklund.memblock-1/lib/arm64, /data/app/se.wiklund.memblock-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]
03-31 22:26:35.896: E/AndroidRuntime(17299):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2373)
03-31 22:26:35.896: E/AndroidRuntime(17299):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2522)
03-31 22:26:35.896: E/AndroidRuntime(17299):    at android.app.ActivityThread.access$900(ActivityThread.java:154)
03-31 22:26:35.896: E/AndroidRuntime(17299):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1389)
03-31 22:26:35.896: E/AndroidRuntime(17299):    at android.os.Handler.dispatchMessage(Handler.java:102)
03-31 22:26:35.896: E/AndroidRuntime(17299):    at android.os.Looper.loop(Looper.java:224)
03-31 22:26:35.896: E/AndroidRuntime(17299):    at android.app.ActivityThread.main(ActivityThread.java:5514)
03-31 22:26:35.896: E/AndroidRuntime(17299):    at java.lang.reflect.Method.invoke(Native Method)
03-31 22:26:35.896: E/AndroidRuntime(17299):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
03-31 22:26:35.896: E/AndroidRuntime(17299):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
03-31 22:26:35.896: E/AndroidRuntime(17299): Caused by: java.lang.ClassNotFoundException: Didn't find class "se.wiklund.memblock.AndroidLauncher" on path: DexPathList[[zip file "/data/app/se.wiklund.memblock-1/base.apk"],nativeLibraryDirectories=[/data/app/se.wiklund.memblock-1/lib/arm64, /data/app/se.wiklund.memblock-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]
03-31 22:26:35.896: E/AndroidRuntime(17299):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
03-31 22:26:35.896: E/AndroidRuntime(17299):    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
03-31 22:26:35.896: E/AndroidRuntime(17299):    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
03-31 22:26:35.896: E/AndroidRuntime(17299):    at android.app.Instrumentation.newActivity(Instrumentation.java:1068)
03-31 22:26:35.896: E/AndroidRuntime(17299):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2363)
03-31 22:26:35.896: E/AndroidRuntime(17299):    ... 9 more
03-31 22:26:35.896: E/AndroidRuntime(17299):    Suppressed: java.lang.NoClassDefFoundError: se.wiklund.memblock.AndroidLauncher
03-31 22:26:35.896: E/AndroidRuntime(17299):        at dalvik.system.DexFile.defineClassNative(Native Method)
03-31 22:26:35.896: E/AndroidRuntime(17299):        at dalvik.system.DexFile.defineClass(DexFile.java:226)
03-31 22:26:35.896: E/AndroidRuntime(17299):        at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
03-31 22:26:35.896: E/AndroidRuntime(17299):        at dalvik.system.DexPathList.findClass(DexPathList.java:338)
03-31 22:26:35.896: E/AndroidRuntime(17299):        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
03-31 22:26:35.896: E/AndroidRuntime(17299):        ... 13 more
03-31 22:26:35.896: E/AndroidRuntime(17299):    Suppressed: java.lang.ClassNotFoundException: se.wiklund.memblock.AndroidLauncher
03-31 22:26:35.896: E/AndroidRuntime(17299):        at java.lang.Class.classForName(Native Method)
03-31 22:26:35.896: E/AndroidRuntime(17299):        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
03-31 22:26:35.896: E/AndroidRuntime(17299):        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
03-31 22:26:35.896: E/AndroidRuntime(17299):        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
03-31 22:26:35.896: E/AndroidRuntime(17299):        ... 12 more
03-31 22:26:35.896: E/AndroidRuntime(17299):    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

编辑:它在Android Studio中运行良好,因此它必须与Eclipse有关。但是如果可能的话,我真的想坚持使用Eclipse。

2 个答案:

答案 0 :(得分:0)

找不到

se.wiklund.memblock.AndroidLauncher 类。检查您的依赖项/库,因为日志会在 DexPathList 中找不到它。

在发布之前你应该寻找类似的问题:

Android ClassNotFoundException: Didn't find class on path

  

我的项目遇到了同样的问题。这是因为我的项目和我在项目中添加的库项目之间的android支持库版本冲突。将相同版本的android支持库放在您包含的项目和库项目中并清理构建......一切都会工作......

Didn't find class on path: dexpathlist

  

这里的问题相同。对我有用的是将android-support-v4.jar添加为lib并确保在项目属性上检查 - >构建路径 - >订单&出口。有人提到here

答案 1 :(得分:0)

我通过安装此Gradle插件解决了这个问题:(http://dist.springsource.com/snapshot/TOOLS/gradle/nightly)。我之前使用过与Eclipse集成的那个。