CCTMXTiledMap not loading on Android

CCTMXTiledMap not loading on Android
0.0 0



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!


probably this solution works also for you:



Thanks, this solution works!