Build on Android isn't working

Build on Android isn't working
0.0 0


this is getting me crazy, I’m developing a game using cocos2d-x with visual studio 2012, everything runs fine on Windows, I installed Eclipse, ADT, NDK, ANT and set all the environment variables, the app is compiling/building succesfully but when I test it on my device (HTC One X with Cyanogenmod)appears just a black screen.

It seems it crashed but checking the LogCat the following message is repeating over and over (infinite loop)

02-05 21:46:01.772: D/dalvikvm(27256): Trying to load lib /data/app-lib/com.Binmatter.MyGame-2/ 0x4215b498
02-05 21:46:01.772: A/libc(27256): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 27256 (tter.MyGame)

Any ideas of what’s happening?


Hello Victor,
I have run into a similar situation before, but I’d like to know if this is the same as what I met.
Could you please tell me how did you build the project? Did you use ./ or just clicked the ‘build’ button in Eclipse?
Did the game crash (exit automatically) after the black screen or it keeps showing the black screen?

Please tell me if possible. Thanks!


Hello Shiqing,
I’m building directly from eclipse.
It doesn’t crash, keeps showing the black screen.

I’ve compiled before (an early version of the game and cocos2d-x) and worked great. But later I reinstalled eclipse, the SDKs and everything and now I can’t get it to work.

I’m using the following now:
cocos2d-x v2.2.2



Ok. I fixed it.
I use some singletons for retrieving the player’s score and other data so I store it in global variables to access them from any class instance.

Not working on Android:
Declaration of the variable assigning the retrieved score.

int Global::score = CCUserDefault::sharedUserDefault()->getIntegerForKey(“score”, 0);

Declaration of the variable assigning 0 and later on call the loadData function

int Global::score = 0;

void Global::loadData()

Global::score = CCUserDefault::sharedUserDefault()->getIntegerForKey(“score”, 0);