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

15,073

Solution 1

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.

Solution 2

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.

Solution 3

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.

Solution 4

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.

Solution 5

Removing the reference and adding it again to the project did the job for me! you might need to clean the project.

Share:
15,073

Related videos on Youtube

user3040900
Author by

user3040900

Updated on October 04, 2022

Comments

  • user3040900
    user3040900 over 1 year

    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

  • Matt Cooper
    Matt Cooper over 9 years
    I came across this problem when switching my deployment target from iOS 8 to iOS 7. Apparently iOS 8 handles automatically handling .jpg extensions in +imageNamed:, but iOS 7 does not