0
votes

I am getting error on debugger:

cocos2d: CCTexture2D. Can't create Texture. UIImage is nil cocos2d: Couldn't add image:bg.png in CCTextureCache * Assertion failure in -[StartTrain addChild:z:tag:], /Users/nishant/Downloads/AnimBear 2/libs/cocos2d/CCNode.m:370 * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Argument must be non-nil'

An Application runs on simulator but not on actual device. please help.. :(

2
Maybe your image is too big. How big is the image resolution ?Andrew
oh thanks I got the solution. I have not converted it to jpg to png. I have only changed the extension from jpg to png.user392406

2 Answers

0
votes

Is your device an iPhone 4? Someone on the cocos2d-iphone forums had a similar problem; this thread documents what he tried and what ended up solving the problem. It's possible that the hd version of the image you are trying to load is too large or is not in the correct format.

If you are running 0.99.5 rc1, you may also want to upgrade to the release version of 0.99.5, as mentioned in this thread about another similar problem.

0
votes

I had a similar problem, the name of the file was correct, format was correct (was .png) and I had cleaned in xcode and deleted the app from my iphone, yet I still had the error.

As someone else said in the comment, the size of the sprite just might be too large (depending on your memory usage). For me I had all sorts of sprites and stuff flying over the screen. So I resized it and it currently runs perfect.

Also I was using a iPhone 3G.