cocos2d-x 游戏在部份虚拟机上面闪退的原因

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/lovesmiles/article/details/52125890

我们项目用cocos2d-x开发的游戏在部份模拟器上面会闪退,闪退时的log留下一句

Fatal signal 11 (SIGSEGV) at 0x00000000 (code=128)  //注意这里面的code是128,不是1。

闪退的地方是随机的,通常是在游戏初始化时用到cocos2d的渲染就会闪退,在真机上面不会,只在部份虚拟机上出现。


现在查明,是由于部份虚拟机是x86架构的,x86架构跑cocos2d的程序,在编译so文件时,需要将某个优化选项关掉。

具体的官方说明如下:

https://github.com/cocos2d/cocos2d-x/issues/8964


Hello,

Yes, you can check by extending APP_CPPFLAGS directive on your Application.mk file like
APP_CPPFLAGS := [other flags...] -U__SSE__

Probably there also must be some logic added to disable sse instructions for x86 ABI only, instead of all declared abis within APP_ABI directive.


意思就是在 Application.mk文件的加上这个

APP_CPPFLAGS := [other flags...]-U__SSE__

重新ndk编译即可

这样的问题用google一查就可以查出来,但用百度是查到你死都查不出来的。

诅咒百度,虽然自己的力量渺小,希望能为它的早日倒闭提供一份怨念。在信息化时代,还要阻止信息的流通,再一次诅咒闭关锁国的大清政府。




展开阅读全文

cocos2d-x】Android真机调试出现闪退

10-30

之前真机调试还没有出现问题,昨天真机调试突然出现闪退情况,看log好像是虚拟机挂掉了,解了一天的bug都没有解出来,跪求大神帮忙。错误log贴在下面:rnrn10-29 14:24:55.093: D/dalvikvm(27569): VFY: replacing opcode 0x1c at 0x000arn10-29 14:24:55.116: D/test(27569): created from taskrn10-29 14:24:55.171: D/dalvikvm(27569): GC_CONCURRENT freed 152K, 9% free 11448K/12487K, paused 2ms+4msrn10-29 14:24:55.421: D/dalvikvm(27569): Trying to load lib /data/data/com.xxx.xxx/lib/libBugly.so 0x41607758rn10-29 14:24:55.421: D/dalvikvm(27569): Shared lib '/data/data/com.xxx.xxx/lib/libBugly.so' already loaded in same CL 0x41607758rn10-29 14:24:55.421: I/CrashReport(27569): setLogMode 6 current 4rn10-29 14:24:55.507: D/libEGL(27569): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.sorn10-29 14:24:55.546: D/libEGL(27569): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.sorn10-29 14:24:55.554: D/libEGL(27569): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.sorn[color=#FF0000]10-29 14:24:55.577: E/dalvikvm(27569): JNI ERROR (app bug): accessed stale weak global reference 0xffffffff (index 65535 in a table of size 2)rn10-29 14:24:55.577: E/dalvikvm(27569): VM aborting[/color]rn10-29 14:24:55.577: E/CrashReport(27569): HandleSignal start 11rn10-29 14:24:55.577: E/CrashReport(27569): NativeRQDVersion:nativeBugly_1.0.1rn10-29 14:24:55.648: E/CrashReport(27569): cause by fatal signal SIGSEGVrn10-29 14:24:55.648: E/CrashReport(27569): collect crashInforn10-29 14:24:56.054: D/CLIPBOARD(27569): Hide Clipboard dialog at Starting input: finished by someone else... !rn10-29 14:24:56.077: D/cocos2d-x debug info(27569): rn10-29 14:24:56.077: D/cocos2d-x debug info(27569): cocos2d.x.version: cocos2d-x 2.2.6rn10-29 14:24:56.077: D/cocos2d-x debug info(27569): cocos2d.x.compiled_with_profiler: falsern10-29 14:24:56.077: D/cocos2d-x debug info(27569): cocos2d.x.compiled_with_gl_state_cache: truern10-29 14:24:56.077: D/cocos2d-x debug info(27569): gl.vendor: Imagination Technologies 论坛

没有更多推荐了,返回首页