简体   繁体   中英

LibGDX Android App Crashes on Startup

When I run my project it instantly crashes and outputs this. I created a new fresh project, but it crashed as well. I am using Eclipse, because I do really like it.

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

EDIT: It works fine in Android Studio, so it has to be something with Eclipse. But I really want to stick to Eclipse if possible.

se.wiklund.memblock.AndroidLauncher class is not found. Check your dependencies/libraries as log warns about it's not found in DexPathList .

And you should look for similar questions before posting one:

Android ClassNotFoundException: Didn't find class on path

I had the same issue for my project.It happened due to the conflict in android support library version between my project and the library project that i added in my project. Put the same version android support library in your project and library projects you included and clean build... Everything will work...

Didn't find class on path: dexpathlist

Same problem here. What worked for me was adding android-support-v4.jar as a lib and making sure it was checked on Project properties -> Build Path -> Order & export. It was mentioned here

I solved it by installing the this Gradle plugin: ( http://dist.springsource.com/snapshot/TOOLS/gradle/nightly ). I used the one that is integrated with Eclipse before.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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