Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/352.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 从外部项目引用类导致android应用程序崩溃_Java_Android_Eclipse_Libgdx - Fatal编程技术网

Java 从外部项目引用类导致android应用程序崩溃

Java 从外部项目引用类导致android应用程序崩溃,java,android,eclipse,libgdx,Java,Android,Eclipse,Libgdx,我需要在项目之间共享一些类,所以我将它们移动到了一个外部项目中,并添加了构建路径和引用。现在安卓版坏了,而桌面版仍能正常工作。有什么我可能错过的吗?我从运行android应用程序中得到的只是一条“停止工作”的消息 我找到了一些logcat数据。抱歉,还不太熟悉logcat 09-21 12:39:13.778: W/dalvikvm(30243): threadid=11: thread exiting with uncaught exception (group=0x418dfda0) 09-

我需要在项目之间共享一些类,所以我将它们移动到了一个外部项目中,并添加了构建路径和引用。现在安卓版坏了,而桌面版仍能正常工作。有什么我可能错过的吗?我从运行android应用程序中得到的只是一条“停止工作”的消息

我找到了一些logcat数据。抱歉,还不太熟悉logcat

09-21 12:39:13.778: W/dalvikvm(30243): threadid=11: thread exiting with uncaught exception (group=0x418dfda0)
09-21 12:39:13.778: E/AndroidRuntime(30243): FATAL EXCEPTION: GLThread 2437
09-21 12:39:13.778: E/AndroidRuntime(30243): Process: mg.realmofradiance.android, PID: 30243
09-21 12:39:13.778: E/AndroidRuntime(30243): java.lang.NoClassDefFoundError: mg.realmofradiance.shared.Network
09-21 12:39:13.778: E/AndroidRuntime(30243):    at mg.realmofradiance.ChatClient.<init>(ChatClient.java:50)
09-21 12:39:13.778: E/AndroidRuntime(30243):    at mg.realmofradiance.RealmOfRadiance.create(RealmOfRadiance.java:20)
09-21 12:39:13.778: E/AndroidRuntime(30243):    at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:236)
09-21 12:39:13.778: E/AndroidRuntime(30243):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1520)
09-21 12:39:13.778: E/AndroidRuntime(30243):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248)

您可能已经将构建系统配置为搜索路径(因此Eclipse知道如何编译代码并查找错误),但是缺少更改APK构建方式的配置。我认为您需要遵循中的设置说明(在“引用库项目”下)。属性->安卓->库+添加。

你检查过你的logcat吗?@TCA还不太熟悉logcat。找不到错误,它等待调试,然后崩溃,logcat为空。@TCA当我刚刚运行它时,logcat发出的最后一条消息是“正在尝试加载mg.packagename.android-4/libgdx.so”引用的包是mg.packagename.shared,那么它是否达到了目标?
mg.realmofradiance (client)
mg.realmofradiance.server (server)
mg.realmofradiance.shared (shared classes)
mg.realmofradiance.shared.Network is currently the only class I need to access to from both client and server.