I’ve published a Cocos2D-X game in Play Store and received some error reports.
In some devices, the game crashes right after the game being launched.
I did some investigation and found out that the usage of sub rect in CCSprites has caused the error to appear in some devices.
Assert error C:/…/cocos2d/cocoa/ccobject.cpp Function:retain line:92
For example, this line would cause error:
CCSprite *mySprite = CCSprite::create("sprite.png", CCRect(0, 0, 120, 120));
This is really annoying since I used a lot of spritesheets in the game.
The devices I tested that runs the game without problem are:
- Lenovo A790e / Android 2.3
- Samsung Galaxy Gio GT-S5660 / Android 2.3
- Sony Xperia U ST25i / Android 2.3
- Sony Xperia Tipo ST21i / Android 4.0
- Samsung Galaxy Ace GT-S5830 / Android 2.3
- Samsung Galaxy S III GT-I9300 / Android 4.1.2
- HTC Sensation 4G / Android 4.0
- Cyrus Atompad / Android 4.0 (local tablet brand)
Devices I tested that cannot run the game are:
- Samsung Galaxy Young GT-S5360 / Android 2.3
- Samsung Galaxy Nexus GT-I9250 / Android 4.1
- Huawei U9200 / Android 4.0
- Samsung Galaxy Tab GT-P1010 / Android 2.2
- Polytron Wizard Crystal W3430 / Android 4.0
I used Cocos2D-x 2.0.4 on the published game. I also tried using 2.1.1 but I got exactly the same result on the same devices.
Is there any workaround for ths?