我刚从0安装了一个引擎。我不得不花2天时间。很多问题和非常糟糕的教程与不完整的信息。最后它起作用,除了我需要的例子,一切正常。我在项目中下载并加载了所有扩展。 我正在使用this扩展名。所有其他示例,或其中许多示例正在运行。背景>使用TMXTiledMap崩溃。
这是来自logcat的日志文件
06-15 01:10:33.153: E/dalvikvm(28675): Could not find class 'org.andengine.extension.tmx.TMXLoader', referenced from method org.andengine.examples.TMXTiledMapExample.onCreateScene
06-15 01:10:33.153: W/dalvikvm(28675): VFY: unable to resolve new-instance 1050 (Lorg/andengine/extension/tmx/TMXLoader;) in Lorg/andengine/examples/TMXTiledMapExample;
06-15 01:10:33.153: D/dalvikvm(28675): VFY: replacing opcode 0x22 at 0x000f
06-15 01:10:33.153: W/dalvikvm(28675): VFY: unable to resolve exception class 1054 (Lorg/andengine/extension/tmx/util/exception/TMXLoadException;)
06-15 01:10:33.153: W/dalvikvm(28675): VFY: unable to find exception handler at addr 0xfb
06-15 01:10:33.153: W/dalvikvm(28675): VFY: rejected Lorg/andengine/examples/TMXTiledMapExample;.onCreateScene ()Lorg/andengine/entity/scene/Scene;
06-15 01:10:33.153: W/dalvikvm(28675): VFY: rejecting opcode 0x0d at 0x00fb
06-15 01:10:33.153: W/dalvikvm(28675): VFY: rejected Lorg/andengine/examples/TMXTiledMapExample;.onCreateScene ()Lorg/andengine/entity/scene/Scene;
06-15 01:10:33.153: W/dalvikvm(28675): Verifier rejected class Lorg/andengine/examples/TMXTiledMapExample;
06-15 01:10:33.153: W/dalvikvm(28675): Class init failed in newInstance call (Lorg/andengine/examples/TMXTiledMapExample;)
06-15 01:10:33.153: D/AndroidRuntime(28675): Shutting down VM
06-15 01:10:33.153: W/dalvikvm(28675): threadid=1: thread exiting with uncaught exception (group=0x2b542210)
06-15 01:10:33.153: E/AndroidRuntime(28675): FATAL EXCEPTION: main
06-15 01:10:33.153: E/AndroidRuntime(28675): java.lang.VerifyError: org/andengine/examples/TMXTiledMapExample
06-15 01:10:33.153: E/AndroidRuntime(28675): at java.lang.Class.newInstanceImpl(Native Method)
06-15 01:10:33.153: E/AndroidRuntime(28675): at java.lang.Class.newInstance(Class.java:1319)
06-15 01:10:33.153: E/AndroidRuntime(28675): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
06-15 01:10:33.153: E/AndroidRuntime(28675): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1882)
06-15 01:10:33.153: E/AndroidRuntime(28675): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
06-15 01:10:33.153: E/AndroidRuntime(28675): at android.app.ActivityThread.access$600(ActivityThread.java:127)
06-15 01:10:33.153: E/AndroidRuntime(28675): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
06-15 01:10:33.153: E/AndroidRuntime(28675): at android.os.Handler.dispatchMessage(Handler.java:99)
06-15 01:10:33.153: E/AndroidRuntime(28675): at android.os.Looper.loop(Looper.java:137)
06-15 01:10:33.153: E/AndroidRuntime(28675): at android.app.ActivityThread.main(ActivityThread.java:4441)
06-15 01:10:33.153: E/AndroidRuntime(28675): at java.lang.reflect.Method.invokeNative(Native Method)
06-15 01:10:33.153: E/AndroidRuntime(28675): at java.lang.reflect.Method.invoke(Method.java:511)
06-15 01:10:33.153: E/AndroidRuntime(28675): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
06-15 01:10:33.153: E/AndroidRuntime(28675): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
06-15 01:10:33.153: E/AndroidRuntime(28675): at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:1)
尝试右键单击您的android项目,然后转到android,项目并添加扩展名作为项目的引用。
答案 1 :(得分:1)
确保您从GitHub上的存储库中检出了扩展程序(我希望您从那里获得AndEngine,Google Code上的其他存储库严重过时,GitHub是该引擎的唯一主页)。
https://github.com/nicolasgramlich/
https://github.com/nicolasgramlich/AndEngineTMXTiledMapExtension