我不知道该怎么做。我让libGDX为Desktop和Android安装了Eclipse项目,然后尝试在我的Android平板电脑上启动它(我不会使用avd,因为它非常慢)。在安装了apk之后,它立即尝试启动它,然后应用程序崩溃。我还没有修改任何项目代码。似乎当我在Android设备上启动应用程序时,它无法找到课程。也许有人可以告诉我从LogCat输出中我要做什么。
06-02 02:07:27.430: W/dalvikvm(17018): Unable to resolve superclass of Lcom/test/game/AndroidLauncher; (3)
06-02 02:07:27.430: W/dalvikvm(17018): Link of class 'Lcom/test/game/AndroidLauncher;' failed
06-02 02:07:27.430: D/AndroidRuntime(17018): Shutting down VM
06-02 02:07:27.430: W/dalvikvm(17018): threadid=1: thread exiting with uncaught exception (group=0x415edba8)
06-02 02:07:27.430: E/AndroidRuntime(17018): FATAL EXCEPTION: main
06-02 02:07:27.430: E/AndroidRuntime(17018): Process: com.test.game, PID: 17018
06-02 02:07:27.430: E/AndroidRuntime(17018): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.test.game/com.test.game.AndroidLauncher}: java.lang.ClassNotFoundException: Didn't find class "com.test.game.AndroidLauncher" on path: DexPathList[[zip file "/data/app/com.test.game-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.test.game-1, /vendor/lib, /system/lib]]
06-02 02:07:27.430: E/AndroidRuntime(17018): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2121)
06-02 02:07:27.430: E/AndroidRuntime(17018): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
06-02 02:07:27.430: E/AndroidRuntime(17018): at android.app.ActivityThread.access$800(ActivityThread.java:135)
06-02 02:07:27.430: E/AndroidRuntime(17018): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
06-02 02:07:27.430: E/AndroidRuntime(17018): at android.os.Handler.dispatchMessage(Handler.java:102)
06-02 02:07:27.430: E/AndroidRuntime(17018): at android.os.Looper.loop(Looper.java:136)
06-02 02:07:27.430: E/AndroidRuntime(17018): at android.app.ActivityThread.main(ActivityThread.java:5017)
06-02 02:07:27.430: E/AndroidRuntime(17018): at java.lang.reflect.Method.invokeNative(Native Method)
06-02 02:07:27.430: E/AndroidRuntime(17018): at java.lang.reflect.Method.invoke(Method.java:515)
06-02 02:07:27.430: E/AndroidRuntime(17018): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:813)
06-02 02:07:27.430: E/AndroidRuntime(17018): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:629)
06-02 02:07:27.430: E/AndroidRuntime(17018): at dalvik.system.NativeStart.main(Native Method)
06-02 02:07:27.430: E/AndroidRuntime(17018): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.test.game.AndroidLauncher" on path: DexPathList[[zip file "/data/app/com.test.game-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.test.game-1, /vendor/lib, /system/lib]]
06-02 02:07:27.430: E/AndroidRuntime(17018): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
06-02 02:07:27.430: E/AndroidRuntime(17018): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
06-02 02:07:27.430: E/AndroidRuntime(17018): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
06-02 02:07:27.430: E/AndroidRuntime(17018): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
06-02 02:07:27.430: E/AndroidRuntime(17018): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
06-02 02:07:27.430: E/AndroidRuntime(17018): ... 11 more
如果有人知道出了什么问题,我会很高兴,如果他们可以提供帮助。
答案 0 :(得分:0)
您是否复制了所有原始文件,例如.so
分机或其他文件。没有这个,您的项目将无法运行。某些类必须依赖于本机文件。
答案 1 :(得分:0)
您使用的是外部罐子吗?这些必须位于libs
(确切编写的)文件夹中,或者类不会是#dexed"。如果您没有使用gradle导入项目中的jar,则需要手动添加它以将其包含在构建中。