我开始使用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中,但是我检查了一下,发现该类在那里并且没有错误。那么问题是什么呢?我希望你们知道如何解决这个问题。
答案 0 :(得分:1)
尝试: 1)运行项目清理并重建它 2)在物理设备而不是模拟器上运行它