Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error code: Could not load the "image.png" image referenced from a nib in the bundle with identifier "com.bundle.identifier"

This question has been asked before and i have looked in all of the other stackoverflow topics for an answer, but i can't resolve the issue.

My app works fine in the simulator for all platforms, but when i run the app on my device i get the error code: Could not load the "image.png" image referenced from a nib in the bundle with identifier "com.bundle.identifier".

Screenshot for message on console

All of my pictures are .PNG files and i have used the storeboard to insert them in an imageView.

Program: Xcode 5

like image 363
user3040900 Avatar asked Nov 27 '13 08:11

user3040900


5 Answers

If you are using the image name without extension e.g. [UIImage imageNamed:@"myImage"];
then make sure that your image is of .png format, because Xcode will load only .png images without adding extension, otherwise you should use the name with extension [UIImage imageNamed:@"myImage.jpg"]; and should work.

like image 160
Basheer_CAD Avatar answered Nov 07 '22 17:11

Basheer_CAD


I had the same issue and I resolved it by selecting the check box to add it to app in Target Membership. So, select the image from the library, and then on the File Inspector, add it to the target. It worked for me, hope it works for you as well.

like image 40
ashNair Avatar answered Nov 07 '22 17:11

ashNair


Delete that image from the project and move it to trash and then try re-adding that image to the project by checking copy items to destination's group folder check box clicked.

This may be the reason for the issue for not loading the image in the device.

like image 4
Nazik Avatar answered Nov 07 '22 16:11

Nazik


I resolved this issue by deleting the image named image.png in my storyboard and it worked immediately. This image may also exists in your code or anywhere else.

like image 3
ChenXi Avatar answered Nov 07 '22 15:11

ChenXi


The nib (or ultimately the xib) that is the cause of the warning message is the one that is loaded when the message gets written. You then can look at the controls that use images in the inspector and find one where the image name is "Unknown image" (or perhaps "image.png" in your case). You can then clear this value by setting it to some value and then clearing out the value. Note that with UIButton you'll need to try the four different values of "State Config" (Default, Highlighted, Selected & Disabled) to see where the invalid reference might be hiding.

like image 2
ThomasW Avatar answered Nov 07 '22 16:11

ThomasW