Reputation: 173
I'm developing an application for Android using cocos2d-x. I'm new to cocos2d-x and C++ and I'm on windows, I have followed due process from creating the Cocos2d-x project template for Eclipse to importing the project into Eclipse and adding c++ features to it etc... I succesfully got my app to run in the emulator(target API 4.1) and it gives me the cocos2d "HelloWorld Splash" as expected. Problem is, now I'm trying to change my Application background image. I added an image in the assets directory and changed the code in "HelloWorldScene.cpp" that creates the default HelloWorld Sprite
from:
CCSprite* pSprite = CCSprite::create("HelloWorld.png");
to:
CCSprite* pSprite = CCSprite::create("background.jpg");
Once I do the latter, my emulator crashes after trying to run the App and in logcat I get the error "Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)", but if I put back the default HelloWorld.png it runs again smoothly in the emulator.
I use cocos2d-2.0-rc2-x-2.0.1 and android-ndk-r8b. This App runs only on a 4.1 API device emulator, I can't get it to run on 2.3.3 and 4.3 as it crashes while trying to run. Please, kindly help me out please
Upvotes: 2
Views: 5380
Reputation: 3182
I think you might forget to run the build_native.sh script to update the libgame.so
Upvotes: 3
Reputation: 11
Try troubleshooting your image.
Also ensure that the "HelloWorld.png" is in your Assets directory, if not you may need to add the Assets directory to the search path via CCFileUtils
Good Luck!
Upvotes: 1
Reputation: 235
Upvotes: 1