HelloCpp has stopped - why?

Hello all, I’m now to cocos2d-x.

I recently finished setting up cocos2d-x for Android. I installed all the android SDK, ADT, Eclipse, cygwin, etc etc and imported the sample ‘HelloCpp’ to Eclipse and built it. Initially I failed, but I did a ‘chmod 777 -R’ on all folders of cocos2d-x and the building process was completed successfully.

I can see the app being installed into the emulator 5554 already, but when running it says ‘Unfortunately, HelloCpp has stopped’. The strange thing is that, if I manually put the HellopCpp.apk (found under /bin) into a real device and install it, it works.

What can be the reason for the crash on an emulator? Your help is appreciated. Thanks.

can you paste the logs (google for adb logcat) have u looked at http://www.cocos2d-x.org/forums/6/topics/20459

Could be that you haven’t enabled the “Use Host GPU” in the emulator (common mistake).

See the answer here: http://stackoverflow.com/questions/15432837/android-emulator-show-gpu-overdraw

Thank you very much for your help, prakash, Gav.

Putting this into Application.mk solved the problem. This line is completely missing in the file. Isn’t this a major bug?

APP_ABI := armeabi armeabi-v7a x86

Your app will compile to armeabi by default and and will work on most emulator profiles as they are almost all set to CPU ARM (armeabi or armeabi-v7a which is compatible); So I think you must have changed your “5554” emulator to use “Intel Atom x86” CPU?

You might want to only compile to one of those while you develop (pick either armeabi or x86). Otherwise you will be compiling everything three times (one executable “.so” file for each architecture - see them inside your projects Obj folder) . Put the whole line “APP_ABI := armeabi armeabi-v7a x86” back when you do you release build.

Gav, no I didn’t. my emulator was using armeabi-v7a with host GPU on. I guess things must have changed. Specific APP_ABI is probably mandatory now. It only started building the armeabi-v7a when I have the above line.

Also, we can’t just chmod 777 R the asset directory holding the font now. we have to chmod 777R at a much higher level. In my case, I simply -R the entire cocos2d-x directory.

I’m using the latest eclipse, ndk, sdk.
Visual studio is 2012.
cocos2d-x is 2.2

And thank you for your advice about putting one architecture only. I’ve reduced it to armeabi-v7a for now.