After developing my cocos2d-x game for iOS I’ve been trying to make it run on Android.
I could make it run perfectly on an Sony Xperia Go, but on three other different models, the app crashes with the following error:
- A/libc(2421): heap corruption detected by dlmalloc
It was not easy to pinpoint the error, but I found out that this occurs while loading the resources on the assets folder. There is nothing wrong with the files on the assets folder, and I could reproduce the error with different files.
The error is returned by FileUtilsAndroid (CCFileUtilsAndroid.cpp) in the following line of isFileExist:
AAsset* aa = AAssetManager_open(FileUtilsAndroid::assetmanager, s, AASSET_MODE_UNKNOWN);
I am using the latest version of Android NDK, and cocos2d-x 3.0 beta2 (the latest version from github 3.0 RC, has the same problem)
Is there a fix for this?