Display Scaling - works on One Device, Crashes on another

Display Scaling - works on One Device, Crashes on another
0.0 0


Hi Guys,

Im implementing Scaling in the jni/hellojavascript/main.cpp file in my Cocos2d-x project for Android:

like this:

@ CCEGLView view = CCEGLView::sharedOpenGLView;
pAppDelegate = new AppDelegate();

This code works with a Device: such as the Samsung Galaxy 2, but NOT on the Galaxy 3!

Console dump is this:

9-12 16:37:23.640: DEBUG/Cocos2dxActivity(28386): model=GT-I9300
09-12 16:37:23.640: DEBUG/Cocos2dxActivity(28386): product=m0xx
09-12 16:37:23.640: DEBUG/Cocos2dxActivity(28386): isEmulator=false
09-12 16:37:23.770: DEBUG/cocos2d-x debug info(28386): cocos2d: WARNING: Image (256 x 32) is bigger than the supported 0 x 0
09-12 16:37:23.915: INFO/DEBUG(19974): pid: 28386, tid: 28417, name: Thread-7325  >>> org.cocos2dx.hellojavascript <<<
09-12 16:37:24.205: INFO/DEBUG(19974): #01  pc 00908f50  /data/data/org.cocos2dx.hellojavascript/lib/libcocos2djs.so (__aeabi_ldiv0+8)
09-12 16:37:24.225: INFO/DEBUG(19974): 5e03dafc  5dd90f54  /data/data/org.cocos2dx.hellojavascript/lib/libcocos2djs.so (__aeabi_ldiv0+12)
09-12 16:37:24.225: INFO/DEBUG(19974): 5e03db04  5dba150f  /data/data/org.cocos2dx.hellojavascript/lib/libcocos2djs.so (cocos2d::CCLabelAtlas::updateAtlasValues()+290)
09-12 16:37:32.040: INFO/ActivityManager(2189): Process org.cocos2dx.hellojavascript (pid 28386) (adj 0) has died.

It uses the v2.1.5 platform


Sebastian Scholle wrote:

view->setDesignResolutionSize(1280, 720, kResolutionShowAll);

I have narrowed it down to the line of code above, if I take it out then it works, but then it doesn’t scale on the smaller devices.

Any ideas?


I got the same problem too, but I don’t know what to do

It’s works in iPhone is ordinary, but in android is …….

any one can help me


After I clean it, this problem is clear, why@@

./build_native.sh clean

and rebuild again.