Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Terminating app due to uncaught exception 'Texture Atlas Not Found'

I have created a project that has a simple animation using Sprite Kit. It worked well and there is no problem in it. The error occurs when I merged the files in our working copy.

NSMutableArray *dPFrames = [NSMutableArray array];

SKTextureAtlas *dPAtlas = [SKTextureAtlas atlasNamed:@"dP"]; <<---- Thread 1: signal SIGBART

int numImages = dPAtlas.textureNames.count;

for (int i=1; i <= numImages; i++) {
    NSString *textureName = [NSString stringWithFormat:@"dP%d@2x", i];
    SKTexture *temp = [dPAtlas textureNamed:textureName];
    [dPFrames addObject:temp];

}
_dPAnimateFrames = dPFrames;

SKTexture *temp = _dPAnimateFrames[0];
_dP = [SKSpriteNode spriteNodeWithTexture:temp];
_dP.position = CGPointMake(150, 110);
[self addChild:_dP];

Here is the message in Console:

2013-10-09 10:52:14.777 MyProject[1550:a0b] * Terminating app due to uncaught exception 'Texture Atlas Not Found', reason: 'Texture Atlas Not Found'

I have search and research for answer but unfortunately I found nothing. Please share solution if you have.

like image 497
Vortex Kramer Avatar asked Oct 09 '13 03:10

Vortex Kramer


2 Answers

Go to you'r Project and follow these steps:- 1> Go to Build Settings, 2> Search for Enable Texture Atlas Generation and select YES

like image 61
Deepak Avatar answered Nov 15 '22 19:11

Deepak


I had the same problem and I solved it by Reseting Contents and Settings of the Simulator

From the top bar: iOS Simulator -> Reset Contents and Settings...

I also cleaned the project.

like image 21
Rafa de King Avatar answered Nov 15 '22 20:11

Rafa de King