0

我开始使用 AndEngine,我想使用 GitHub 上包含的一些 AndEngineExamples 作为工作的基础。现在,我已经在 GitHub 上下载了所有内容,Eclipse 在任何扩展或示例上都没有给出任何错误。但是,当我尝试启动 AnalogOnScreenControlsExample 时,它​​崩溃并且我收到以下错误日志:

12-02 14:36:17.566: E/AndroidRuntime(5458):     FATAL EXCEPTION: main
12-02 14:36:17.566: E/AndroidRuntime(5458):     java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.andengine.examples/org.andengine.examples.launcher.ExampleLauncher}: java.lang.ClassNotFoundException: org.andengine.examples.launcher.ExampleLauncher
12-02 14:36:17.566: E/AndroidRuntime(5458):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1891)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at android.app.ActivityThread.access$600(ActivityThread.java:127)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at android.os.Looper.loop(Looper.java:137)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at android.app.ActivityThread.main(ActivityThread.java:4441)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at java.lang.reflect.Method.invokeNative(Native Method)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at java.lang.reflect.Method.invoke(Method.java:511)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at dalvik.system.NativeStart.main(Native Method)
12-02 14:36:17.566: E/AndroidRuntime(5458):     Caused by: java.lang.ClassNotFoundException: org.andengine.examples.launcher.ExampleLauncher
12-02 14:36:17.566: E/AndroidRuntime(5458):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
12-02 14:36:17.566: E/AndroidRuntime(5458):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1882)
12-02 14:36:17.566: E/AndroidRuntime(5458):     ... 11 more

看着这个,我认为问题出在 ExampleLauncher 中,但我检查了一下,发现该类在那里并且没有错误。那么问题可能是什么?我希望你们知道如何解决这个问题。

4

1 回答 1

1

尝试:1)运行项目清理并重建它 2)在物理设备上而不是在模拟器上运行它

于 2012-12-02T13:49:46.380 回答