iamruskie
iamruskie

Reputation: 766

How can I deep clean Xcode?

I tried to update my cocos2d template and now I'm getting:

cocos2d: CCFileUtils: Warning HD file not found: bgs-jungle-hd.png
cocos2d: CCTexture2D. Cant create Texture. UIImage is nil 
cocos2d: Couldnt add image:bgs-jungle.png in CCTextureCache

I tried product -> clean, product -> clean build folder, delete app from device, restart Xcode, but same issue.

I then opened a backup that was running well with older cocos2d and it crashes because of same issue. The file is spelled correctly in all places. There is nothing wrong with my code.

How do I super clean Xcode of all data and history?

Upvotes: 2

Views: 1852

Answers (2)

Kreiri
Kreiri

Reputation: 7850

When your app cannot open a resource, always check two things first: first, that you didn't misspell file name or used wrong capitalization (on device file names are case-sensitive), and second, that this file isn't missing from "copy resources" build phase.

To check that your resources are added to "copy resources" build phase:

In project navigator click on topmost item (your project's name). This will take you to project settings. Select your target, click "Build Phases", open "Copy Bundle Resources" phase. It will list all resource files which will be copied to your app's bundle. You can add missing files with "+" button in the very bottom of the list.

Alternatively, if you select a file in project navigator, in file inspector in right sidebar you can set target membership for this file. Usually checking target for a resource file will add it to that target's "copy resources" phase.

Upvotes: 4

PeakCoder
PeakCoder

Reputation: 852

I have also experienced this problem. When you add resource folders, choose way

"Create folder references for any added folder"

do not choose

"Create groups for any added folders"

Hope it will be helpful :)

Upvotes: 0

Related Questions