I am a n00b when it comes to android and I am trying to get the HelloWorld for Android going. I do have it building sucessfully to a few Android devices, but whenever I push the app to the background and then click the icon I am getting this error with the graphics (obviously) blanked out.
this method always return empty string which makes CCTextureCache::addImage got empty filepath before add texture into volatile texture pool
modify return “”; to return pszRelativePath;
and every thing works fine again.
But the real problem is this (or these) function should be in a file such as CCFileUtils_ios.mm and use some preprocessor to build/run the right function for each platform.
Thanks for fixing #1115, but it looks like a new bug has been introduced in 0.13-beta which causes the same error message “Get data from file(assets/) failed” when you background the android app and then foreground it again.
I put the following CCLog message in CCFileUtils::getFileData to track down the bug:
if (pszFileName[0] != '/')
{
// read from apk
fullPath.insert(0, "assets/");
CCLog("gettingFileData resource path: '%s' full path: '%s'", s_strResourcePath.c_str(), fullPath.c_str());
pData = CCFileUtils::getFileDataFromZip(s_strResourcePath.c_str(), fullPath.c_str(), pSize);
}
And when I run the app for the first time, I get these log messages from adb logcat | grep cocos2d:
That’s all I could figure out for now. Note that the .pvr.ccz file was re-loaded successfully. So it seems like the normal CCSprites loaded from a .png are the ones that are failing to reload.
Thanks.The changing above resolves these problem(include chipmunk,Box2D,and Lua) of 13.0-beta.
Sorry I already upload a movie of these problem as below.
but it has been corrected as the contents of “fully resolved” right now so please forgive me.
Incidentally,I was add a button of the sample of HelloWorld to chipmunk,Box2D because this button certainly exit the apps everytime.
(Please also see below.)
I got same issue on windows. Latest cocos2d-x and VS Express. .h-file fixed to relative, but didn’t uses it.
I had the same dialog box with VS Express c*+ 2008
I was using level helper,sprite helper and cocos2d-x 2.0x2.0.4
I solved it by simply putting the images*in a certain filter hierarchy within the project tree+.
My problem was that the png file was not found where the program looked for it I see that your error comes from a template image, did you moved something?
Also, When I loaded the png images for the first time, VS told me that there was no rule to compile the .png file, I have no Idea ifthis has to do but I just ignored it.