Cocos2dx打包成apk包时在手机上闪退 CCApplication.cpp function:sharedApplication line:60

前端之家收集整理的这篇文章主要介绍了Cocos2dx打包成apk包时在手机上闪退 CCApplication.cpp function:sharedApplication line:60前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

在项目运行过程中,在手机上运行会出现闪退的现象, 报告错误代码如下:

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:60

06-30 10:45:19.921: A/libc(28033): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1),thread 28062 (Thread-3117)

解决方案:

需要修改如下目录下的文件

cocos2dx\platform\android\jni\Java_org_cocos2dx_lib_Cocos2dxRenderer.cpp

修改过程:CCApplication::sharedApplication()->applicationDidEnterBackground();

修改成:

if (CCDirector::sharedDirector()->getOpenGLView()) {
  CCApplication::sharedApplication()->applicationDidEnterBackground();
}


转自:http://www.cnblogs.com/zhang1107/p/3816337.html

猜你在找的Cocos2d-x相关文章