这是我的主项目的目录结构,我从我的Android项目调用。
src
└── legless
├── entities
│ ├── Bullet.java
│ ├── Creep.java
│ └── Hero.java
├── Game.java
└── states
├── GameState.java
└── MessageState.java
在Game.java中,我实例化一个GameState对象。这是我收到错误的行。
04-01 21:12:13.680: E/AndroidRuntime(12949): FATAL EXCEPTION: GLThread 10
04-01 21:12:13.680: E/AndroidRuntime(12949): java.lang.NoClassDefFoundError: legless.states.GameState
04-01 21:12:13.680: E/AndroidRuntime(12949): at legless.Game.initStatesList(Game.java:22)
04-01 21:12:13.680: E/AndroidRuntime(12949): at org.newdawn.slick.state.StateBasedGame.init(StateBasedGame.java:164)
04-01 21:12:13.680: E/AndroidRuntime(12949): at org.newdawn.slick.GDXGameContainer.create(GDXGameContainer.java:135)
04-01 21:12:13.680: E/AndroidRuntime(12949): at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:265)
04-01 21:12:13.680: E/AndroidRuntime(12949): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1356)
04-01 21:12:13.680: E/AndroidRuntime(12949): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
如果需要,AndroidManifest.xml看起来像这样,
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="yasith.legless"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".LeglessRunnerAndroid"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我尝试删除“。”在“&lt; activity android:name =”中。它没有改变任何东西。
非常感谢任何帮助。
答案 0 :(得分:1)
您最近升级到ADT 17吗?如果是,请参阅:http://android.foxykeep.com/dev/how-to-fix-the-classdefnotfounderror-with-adt-17
如果没有,这件事过去是否有用或者从未对你有用过?