CCTMXTiledMap not loading on Android

Hi,

An instance of CCTMXTiledMap works perfectly fine on Blackberry and iOS, but in Android, I’m getting a popup error message when the map tries to load, saying something like “Could not read file data!”, with a reference to the PNG image used in the TMX file. Both the TMX and the PNG are in the Resources folder, and are correctly linked to every project. Here’s the line of code that’s giving me the trouble:

tileMap = CCTMXTiledMap::create(((string) mapName).append(“.tmx”).c_str());

where mapName is a const char* of the TMX file prefix, and tileMap is of type CCTMXTiledMap*. Again, this works perfectly on iOS and Blackberry. Thanks for the help!

Hi,
probably this solution works also for you: http://www.cocos2d-x.org/boards/6/topics/15999?r=17930#message-17930

Giannandrea

Thanks, this solution works!