[SOLVED] game crashes on android only with japanese locale


Our android game crashes when device language is set to Japanese. Here’s the stack trace:

********** Crash dump: ********** Build fingerprint: 'htc_europe/htc_saga/saga:4.2.2/JDQ39/87995:user/release-keys ' pid: 8636, tid: 8668, name: Thread-1485 >>> com.home.myapp <<< signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad Stack frame #00 pc 0000f12c /system/lib/libc.so Stack frame #01 pc 00011ed3 /system/lib/libc.so (dlfree+1458) Stack frame #02 pc 0000d0a1 /system/lib/libc.so (free+12) Stack frame #03 pc 001f1d0d /mnt/asec/com.home.myapp-1/lib/libgam e.so (cocos2d::CCImage::~CCImage()+20): Routine ~CCImage in D:/dev/GoblinDefende rs/proj.android/../../cocos2dx/platform/CCImageCommon_cpp.h:95 Stack frame #04 pc 001f1d29 /mnt/asec/com.home.myapp-1/lib/libgam e.so (cocos2d::CCImage::~CCImage()+4): Routine ~CCImage in D:/dev/GoblinDefender s/proj.android/../../cocos2dx/platform/CCImageCommon_cpp.h:96 Stack frame #05 pc 001ceac9 /mnt/asec/com.home.myapp-1/lib/libgam e.so (cocos2d::CCObject::release()+16): Routine release in D:/dev/GoblinDefender s/proj.android/../../cocos2dx/cocoa/CCObject.cpp:86 Stack frame #06 pc 00204d9f /mnt/asec/com.home.myapp-1/lib/libgam e.so (cocos2d::CCTexture2D::initWithString(char const*, cocos2d::_ccFontDefiniti on*)+334): Routine initWithString in D:/dev/myapp/proj.android/../../c ocos2dx/textures/CCTexture2D.cpp:568 Stack frame #07 pc 001dd0f1 /mnt/asec/com.home.myapp-1/lib/libgam e.so (cocos2d::CCLabelTTF::updateTexture()+44): Routine updateTexture in D:/dev/ myapp/proj.android/../../cocos2dx/label_nodes/CCLabelTTF.cpp:318 Stack frame #08 pc 001dd569 /mnt/asec/com.home.myapp-1/lib/libgam e.so (cocos2d::CCLabelTTF::setString(char const*)+40): Routine setString in D:/d ev/myapp/proj.android/../../cocos2dx/label_nodes/CCLabelTTF.cpp:182 Stack frame #09 pc 001dcd09 /mnt/asec/com.home.myapp-1/lib/libgam e.so (cocos2d::CCLabelTTF::initWithString(char const*, char const*, float, cocos 2d::CCSize const&, cocos2d::CCTextAlignment, cocos2d::CCVerticalTextAlignment)+1 36): Routine initWithString in D:/dev/myapp/proj.android/../../cocos2d x/label_nodes/CCLabelTTF.cpp:143

it happens on very first scene with CCLabelTTFs after most of them is loaded. Deleting of “unsuccessful” strings is not help, it crashes on next scene anyway. It represents on every device (that we have). It works fine with all other languages. I store texts in plist file, game locale is sets as device’s locale automatically on startup. What interesting, rarely, the game starts ok!

I’d be glad if someone could help me with that…
I’m using cocos2d-x-2.1.5.


Are you using TTF font files that support Japanese language characters? I’m just curious.

I’m using only Bitmap fonts (basic ASCII characters) and the game works in Japanese locale …


I’m using generic Arial font. It also runs ok on win32.


Oh, v.2.1.0 also works fine!


Bug resolved :slight_smile: It was hidden in Cocos2dxBitmap.java, 393 line. I replaced that line as it done in cocos2d-x 2.2.0 and now everything works OK (/)


I would go with 2.2, for my projects it was worth it for the bug fixes.