CCMenu::alignItemsVertically on Android

Can anyone confirm that CCMenu::alignItemsVertically works on Android 2.3.3? I’ve been getting crashes based on the following:

CCMenuItemImage playButton = CCMenuItemImage::itemFromNormalImage);
CCMenuItemImage
scoresButton = CCMenuItemImage::itemFromNormalImage(“scores-btn.png”, “scores-btn.png”, this, menu_selector(GameStartScene::scoresButtonAction));
CCMenuItemImage controlsButton = CCMenuItemImage::itemFromNormalImage);
CCMenuItemImage
aboutButton = CCMenuItemImage::itemFromNormalImage(“about-sm-btn.png”, “about-sm-btn.png”, this, menu_selector(GameStartScene::aboutButtonAction));

CCMenu *menu = CCMenu::menuWithItems(playButton, scoresButton, controlsButton, aboutButton, NULL);
menu~~>alignItemsVertically;
menu~~>setPosition(ccp(size.width/2, size.height/2 + 50));
this~~>addChild;
If I comment out menu~~>alignItemsVertically(); it doesn’t crash.

It should work perfectly. I’ve just run your code (but with NULL arguments for the selectors) and it worked fine. Perhaps your problem is related to the selectors (somehow)?

This only happens if you have the default configuration in Application.mk for APP_STL and it’s caused by the dynamic_cast from the menu alignment method.

This particular issue was fixed by switching from

APP_STL := stlport_static

to

APP_STL := gnustl_static

in android/jni/Application.mk

Read more about it here: http://www.cocos2d-x.org/boards/10/topics/7447

Cheers!