Android: app crashing when Sprite sheet seats under HD resources dir

Hello folks,

I have a .pvr sprite sheet that seats under a folder called “hd”.

The relative path for the sheet is “$(APP_DIR)/Resources/hd/srpites.pvr.gz”.

I’m loading the sprites in the sheet like this:

CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile(“sprites.plist”, “sprites.pvr”);

Then I try to create sprites like this:

CCSpriteFrame *spriteFrame = CCSpriteFrameCache::sharedSpriteFrameCache()~~>spriteFrameByName;
CCSprite **sprite = CCSprite::createWithSpriteFrame;
h3.**It works flawlessly on iOS, but crashes on Android.*
h3. The funny thing is on Android if I move my sprite sheet to “$(APP_DIR)/Resource/sprites.pvr.gz” it works fine also!
This makes me think maybe CCFileUtils has some bug on Android which does not take the the resources dir into consideration for sprite sheets?
Or maybe I’m getting this wrong? Any thoughts?
Thanks and regards,
~~ Fabiano

Hm…

I see this is a known issue -> http://www.cocos2d-x.org/issues/1683 .

Still puzzled why it works on iPhone…

Which version are you using?

AFAIK, on android, you need to put the full path. If your file is on something like Resources/ipad/buttons you’d have to use *create( “buttons/sheet.pvr.gz” )* or something.

SOLVED!

Lance, I’m on 2.1beta3-x-2.1.0, but that’s not a bug… shame on me!

Cocos2dx was properly resolving to a 4096x4096 texture, which crashed on my device (Nexus 7).

Thanks,

  • Fabiano