Could not load image "my-icon.png" referenced by the thread (iPhone)

I get the following error message:

2011-02-11 14:47:13.815 myProject[13177:207] Could not load the "icon-troubleshoot.png" image referenced from a nib in the bundle with identifier "com.myCompany.myProject" 

This file is an old file that was used previously but is now deleted. As far as I know, icon-troubleshoot.png not used anywhere in my project. I tried cleaning and restoring, dropping caches, but that didn't work. Finding the troubleshooting line as a text link and "contains" the selected one returns nothing. Does anyone know how I can find the cause of this error?

+3
iphone nib
Feb 11 '11 at 3:50
source share
7 answers

As far as I know, the x-code search tool does not search inside xib files, so your search returns nothing. Anyway, it is really likely that somewhere there is a link in the xib file. Since xib files are just xml, if you don’t want to check all of them manually, try opening your whole xib with the TextMate text editor and doing a global text search on the contents for the .png file name.

Hope this helps. Ciao!

+9
Feb 11 2018-11-11T00:
source share

The warning message has a link to this png file in your .xib or .nib files.

Now the question is how to find it. Xcode does a poor job of this. Opening each nib file in a text editor such as textedit and manual search takes a lot of time.

The best solution for such search tasks is to start the terminal and use the grep command. Go to the source folder of your project in the terminal, then you can run the following in your case:

  grep -i -r --include=*.xib "my-icon.png" ./ 

This will return all * .xib files referenced by my-icon.png. Later, when you see these * .xib files in xcode, you will find '?' instead of mine-icon.png instead of deleting the image is really missing. You have now deleted it to replace it with another image. So choose '?' mark the symbol, open the "Utilities" area (on the right) and select the correct file name. That's all.

+11
Jun 26 2018-12-12T00:
source share

Clean up the whole project and recompile.

+3
Oct 08 '13 at
source share

There should be a link to this file in one of the feathers. If you cannot find it, try deleting the nib file where the image was used and creating a new one.

Also, check your kit for a link to the image file.

+1
Feb 11 '11 at 4:09
source share

I had the same problem, and I found that when I included this file in the project, I did not specify both my development and distribution targets, only Development, so as soon as I tried to create a distribution target, it was not found. You must remove the link to this image, then re-add it and make sure that you have checked all the purposes for which it should be found.

+1
Apr 19 '12 at 22:32
source share

This can happen if you only have an imageName@2x.png image and have started display building without a low resolution retina.

Cut the height and width in half in your favorite image editor, and then save it in the same folder as @ 2x, as imageName.png

0
Oct 08 '13 at
source share

Select the storyboard object in the solution explorer, right-click on the storyboard β†’ "Open As" β†’ "Source Code", now you will see the xml code from the storyboard. Find the image name using Cmd + F and replace or remove it.

0
Dec 31 '14 at 9:48
source share



All Articles