在項目運行過程當中,在手機上運行會出現閃退的現象, 報告錯誤代碼以下:android
06-30 10:45:19.921: E/cocos2d-x assert(28033): E:/workspace/cocos2d-x-2.2.2/projects/****/proj.android/../../../cocos2dx/platform/android/CCApplication.cpp function:sharedApplication line:60app
06-30 10:45:19.921: A/libc(28033): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 28062 (Thread-3117)spa
解決方案:code
須要修改以下目錄下的文件:orm
cocos2dx\platform\android\jni\Java_org_cocos2dx_lib_Cocos2dxRenderer.cppget
修改過程:CCApplication::sharedApplication()->applicationDidEnterBackground();io
修改爲:function
if (CCDirector::sharedDirector()->getOpenGLView()) {
CCApplication::sharedApplication()->applicationDidEnterBackground();
}form