Search code examples
iosxcodecocos2d-xsprite-sheet

SpriteSheet built with TexturePacker not loading in CCSpriteFrameCache


I built a Sprite Sheet using TexturePacker and am then loading it in my app:

CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile( "animation_s4.plist" );

But, when I do this, I get the following error:

Cocos2d: cocos2d: CCSpriteFrameCache: Trying to use file animation_s4.png as texture
Cocos2d: cocos2d: CCSpriteFrameCache: Couldn't load texture

This is in Cocos2d-x and XCode (but don't want to have the issue when I build the Android version too), but I cannot figure out why it can't load my texture. My sprite is a .png file.

Does anyone know what could be the cause of this?


Solution

  • When rebuilding sprite sheets, adding/changing resources one should remove the Derived Data folder to ensure that XCode starts from zero and pulls in fresh copies of all Resources.