我只是在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.
答案 0 :(得分:3)
如果我一次又一次地打开应用程序,它会打开几次之一,之后我在清单中提到它,它总是打开:
android:configChanges="orientation|screenSize"
不知道为什么但是如果你忘了提及这个问题,这就是andengine的问题。