在开放片刻之后,AndEngine游戏就崩溃了

时间:2013-03-11 10:03:18

标签: android andengine

我只是在AndEngine的帮助下测试游戏(实际上它现在只是一个闪屏),并且在CyanogenMod上测试(非正式)它只加载了一毫秒,并关闭。错误是什么?

  • 我已覆盖onDestroy()以添加System.exit(0);
  • 我已延长BaseGameActivity
  • 从班级MainActivity开始运行的部分:

    protected final int width = 640, height = 480;
    public Camera camera;
    
    @Override
    public EngineOptions onCreateEngineOptions() {
        camera = new Camera(0, 0, width, height);
        EngineOptions EO = new EngineOptions(true,
                ScreenOrientation.LANDSCAPE_FIXED,
                new RatioResolutionPolicy(width, height), camera);
        return EO;
    }
    

日志:

E/Trace(2677): error opening trace file: No such file or directory (2)
D/AndEngine(2677): MainActivity.onCreate @(Thread: 'main')    
D/dalvikvm(2677): Trying to load lib /data/data/com.example.package/lib/libandengine.so 0x40dbb400
D/dalvikvm(2677): Added shared lib /data/data/com.example.package/lib/libandengine.so 0x40dbb400
D/dalvikvm(2677): No JNI_OnLoad found in /data/data/com.example.package/lib/libandengine.so 0x40dbb400, skipping init
D/AndEngine(2677): MainActivity.onResume @(Thread: 'main')
D/AndEngine(2677): MainActivity.onPause @(Thread: 'main')
D/AndEngine(2677): MainActivity.onDestroy @(Thread: 'main')
D/AndEngine(2677): UpdateThread interrupted. Don't worry - this EngineDestroyedException is most likely expected!
D/AndEngine(2677): org.andengine.engine.Engine$EngineDestroyedException
D/AndEngine(2677):  at org.andengine.engine.Engine.throwOnDestroyed(Engine.java:574)
D/AndEngine(2677):  at org.andengine.engine.Engine.onTickUpdate(Engine.java:560)
D/AndEngine(2677):  at org.andengine.engine.Engine$UpdateThread.run(Engine.java:820)
D/AndEngine(2677): MainActivity.onDestroyResources @(Thread: 'main')
D/AndEngine(2677): MainActivity.onGameDestroyed @(Thread: 'main')
I/AndroidRuntime(2677): VM exiting with result code 0, cleanup skipped.

1 个答案:

答案 0 :(得分:3)

如果我一次又一次地打开应用程序,它会打开几次之一,之后我在清单中提到它,它总是打开:

android:configChanges="orientation|screenSize"

不知道为什么但是如果你忘了提及这个问题,这就是andengine的问题。