如何修复“ java.lang.RuntimeException:无法实例化活动...:找不到类”错误?

时间:2019-05-12 15:01:01

标签: java android libgdx runtime-error classnotfoundexception

我一直试图将lingdx引擎安装到eclipse中,并在设备上打开默认的android程序(红色背景)。连接成功,但应用程序立即关闭,并且出现“ RuntimeException ...找不到路径”错误。我在Google中搜索了该错误,但找不到我的错误。我在哪里做错了?

日志文件:

print(list(map(g, res[-1] + [0], [0] + res[-1])))

AndroidManifest.xml:

05-12 16:36:27.625: E/AndroidRuntime(521): FATAL EXCEPTION: main
05-12 16:36:27.625: E/AndroidRuntime(521): Process: com.mygdx.gameee, PID: 521
05-12 16:36:27.625: E/AndroidRuntime(521): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mygdx.gameee/com.mygdx.gameee.AndroidLauncher}: java.lang.ClassNotFoundException: Didn't find class "com.mygdx.gameee.AndroidLauncher" on path: DexPathList[[zip file "/data/app/com.mygdx.gameee-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mygdx.gameee-1/lib/arm, /system/fake-libs, /data/app/com.mygdx.gameee-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
05-12 16:36:27.625: E/AndroidRuntime(521):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2868)
05-12 16:36:27.625: E/AndroidRuntime(521):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3064)
05-12 16:36:27.625: E/AndroidRuntime(521):  at android.app.ActivityThread.-wrap14(ActivityThread.java)
05-12 16:36:27.625: E/AndroidRuntime(521):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1659)
05-12 16:36:27.625: E/AndroidRuntime(521):  at android.os.Handler.dispatchMessage(Handler.java:102)
05-12 16:36:27.625: E/AndroidRuntime(521):  at android.os.Looper.loop(Looper.java:154)
05-12 16:36:27.625: E/AndroidRuntime(521):  at android.app.ActivityThread.main(ActivityThread.java:6816)
05-12 16:36:27.625: E/AndroidRuntime(521):  at java.lang.reflect.Method.invoke(Native Method)
05-12 16:36:27.625: E/AndroidRuntime(521):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
05-12 16:36:27.625: E/AndroidRuntime(521):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
05-12 16:36:27.625: E/AndroidRuntime(521): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.mygdx.gameee.AndroidLauncher" on path: DexPathList[[zip file "/data/app/com.mygdx.gameee-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mygdx.gameee-1/lib/arm, /system/fake-libs, /data/app/com.mygdx.gameee-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
05-12 16:36:27.625: E/AndroidRuntime(521):  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
05-12 16:36:27.625: E/AndroidRuntime(521):  at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
05-12 16:36:27.625: E/AndroidRuntime(521):  at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
05-12 16:36:27.625: E/AndroidRuntime(521):  at android.app.Instrumentation.newActivity(Instrumentation.java:1086)
05-12 16:36:27.625: E/AndroidRuntime(521):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2858)
05-12 16:36:27.625: E/AndroidRuntime(521):  ... 9 more

谢谢您的帮助!

1 个答案:

答案 0 :(得分:-1)

用户是Android Studio,而不是Eclipse。 Android开发不支持Eclipse。