Search code examples
iosxcodexcode9.1

Could not load the xxx image referenced from a nib in the bundle with identifier xxx


I have created a new iOS project for a sample app and I dragged and dropped a random image in a new image set in Assets.xcassets and left it with the default name "Image" then in my main storyboard in the generated ViewController I referenced this image in an ImageView I created and when I run the app in my Simulator which is an Iphone7 plus - IOS 11.1 Simulator I get this error instantly.

muzdan[10744:181481] Could not load the "Image" image referenced from a nib in the bundle with identifier "com.example.amr"

The name of the image file i added is "small.png" and I did check the target membership in the file inspector on the right. I also tired filling the image set with the right pixels 1x 2x 3x I did check the target membership in the file inspector on the right

The Storyboard Storyboard

This problem happened to me in another project so i made this project to check whats wrong and is it from that project or something else and I guess its not from the project. I had everything working till yesterday with the other project and suddenly every image in my project is giving me this error. What could it be can someone help me please ??

These are my tools > Xcode 9.1 - Swift 4.0

I cleaned the build and the build folder from the product menu and I even tried resetting Xcode by these commands

defaults delete com.apple.dt.Xcode
rm -rf ~/Libarary/Application\Support/Xcode
rm -rf ~/Libarary/Developer/Xcode/DerivedData/ModuleCache

and I did reset the simulator content and settings but still the same problem comes back I am hopeless right now I tried every solution in the internet but nothing works.

ps. I did not test the app in a physical device or another Mac because I don't have one


Solution

  • So in the end i installed Xcode 10.1 and updated my project codebase to swift 4.2.1 , iOS 12.1 and everything seems to work fine .. The problem where in Xcode 9.1