{"id":3284,"date":"2014-03-21T20:22:23","date_gmt":"2014-03-21T20:22:23","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/21\/cocos2d-ccspriteframecache-couldnt-load-texture-file-collection-of-common-programming-errors-2\/"},"modified":"2014-03-21T20:22:23","modified_gmt":"2014-03-21T20:22:23","slug":"cocos2d-ccspriteframecache-couldnt-load-texture-file-collection-of-common-programming-errors-2","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/21\/cocos2d-ccspriteframecache-couldnt-load-texture-file-collection-of-common-programming-errors-2\/","title":{"rendered":"Cocos2d CCSpriteFrameCache: couldn&#39;t load texture file-Collection of common programming errors"},"content":{"rendered":"<p>I am currently doing this Cocos2d tutorial: http:\/\/www.raywenderlich.com\/1271\/how-to-use-animations-and-sprite-sheets-in-cocos2d<\/p>\n<p>&#8230;and get the following error messages:<\/p>\n<pre><code>2011-12-30 16:36:28.536 AnimBear[11273:10a03] cocos2d: CCTexture2D. Can't create Texture. UIImage is nil\n2011-12-30 16:36:28.537 AnimBear[11273:10a03] cocos2d: Couldn't add image:AnimBear_default.png.ccz in CCTextureCache\n2011-12-30 16:36:28.537 AnimBear[11273:10a03] cocos2d: CCSpriteFrameCache: couldn't load texture file. File not found: AnimBear_default.png.ccz\n2011-12-30 16:36:28.538 AnimBear[11273:10a03] cocos2d: CCTexture2D. Can't create Texture. UIImage is nil\n2011-12-30 16:36:28.538 AnimBear[11273:10a03] cocos2d: Couldn't add image:AnimBear_default.png.ccz in CCTextureCache\n2011-12-30 16:36:28.539 AnimBear[11273:10a03] cocos2d: CCSpriteFrameCache: couldn't load texture file. File not found: AnimBear_default.png.ccz\n2011-12-30 16:36:28.540 AnimBear[11273:10a03] cocos2d: CCTexture2D. Can't create Texture. UIImage is nil\n2011-12-30 16:36:28.540 AnimBear[11273:10a03] cocos2d: Couldn't add image:AnimBear_default.png.ccz in CCTextureCache\n2011-12-30 16:36:28.541 AnimBear[11273:10a03] cocos2d: CCSpriteFrameCa[Switching to process 11273 thread 0x1410b]\n[Switching to process 11273 thread 0x10a03]\nche: Frame 'bear1.png' not found\n2011-12-30 16:36:28.598 AnimBear[11273:10a03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'\n*** First throw call stack:\n(0x17e4052 0x1975d0a 0x17d136e 0x17d2220 0xc1997 0x3fcf1 0xc16dd 0xc0d7c 0x828b0e 0x8298a6 0x838743 0x8391f8 0x82caa9 0x2798fa9 0x17b81c5 0x171d022 0x171b90a 0x171adb4 0x171accb 0x8292a7 0x82aa9b 0xc085f 0x2135)\nterminate called throwing an exceptionsharedlibrary apply-load-rules all\n<\/code><\/pre>\n<p>I have the following files in the Resource folder:<\/p>\n<ul>\n<li>AnimBear_default.png.ccz<\/li>\n<li>AnimBear_default.plist<\/li>\n<\/ul>\n<p>The texture consists of eight(8) bears named Bear1.png &#8211; Bear8.png. I have bought and done the texture in Zwoptex, latest version.<\/p>\n<p>The code looks like:<\/p>\n<pre><code>-(id) init {\n\nif((self = [super init])) {\n\n    [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@\"AnimBear_default.plist\" textureFile:@\"AnimBear_default.png.ccz\"];\n    CCSpriteBatchNode *spriteSheet = [CCSpriteBatchNode batchNodeWithFile:@\"AnimBear_default.png.ccz\"];\n    [self addChild:spriteSheet];\n\n    NSMutableArray *walkAnimFrames = [NSMutableArray array];\n    for (int i = 1; i<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I am currently doing this Cocos2d tutorial: http:\/\/www.raywenderlich.com\/1271\/how-to-use-animations-and-sprite-sheets-in-cocos2d &#8230;and get the following error messages: 2011-12-30 16:36:28.536 AnimBear[11273:10a03] cocos2d: CCTexture2D. Can&#8217;t create Texture. UIImage is nil 2011-12-30 16:36:28.537 AnimBear[11273:10a03] cocos2d: Couldn&#8217;t add image:AnimBear_default.png.ccz in CCTextureCache 2011-12-30 16:36:28.537 AnimBear[11273:10a03] cocos2d: CCSpriteFrameCache: couldn&#8217;t load texture file. File not found: AnimBear_default.png.ccz 2011-12-30 16:36:28.538 AnimBear[11273:10a03] cocos2d: CCTexture2D. Can&#8217;t create Texture. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3284","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3284"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3284\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}