degee
degee

Reputation: 173

Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 655 (Thread-77)

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

Answers (3)

m.ding
m.ding

Reputation: 3182

I think you might forget to run the build_native.sh script to update the libgame.so

Upvotes: 3

muzzylogic
muzzylogic

Reputation: 11

Try troubleshooting your image.

  • Take the "HelloWorld.png" and modify it in whatever image editor you use. If it works then you know it's not your editor.
  • Try making your background image the same size as "HelloWorld.png" and in PNG format with the same default settings as "HelloWorld.png"

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

GizmoThunder
GizmoThunder

Reputation: 235

  • Stick to png image format.
  • Make sure that your image is copied to assets directory on android project.(This happens automatically if you have the image in Resources directory).

Upvotes: 1

Related Questions