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

后端 未结 22 2881
渐次进展
渐次进展 2020-12-01 11:32

when I load my application it shows a warning message that

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

相关标签:
22条回答
  • 2020-12-01 12:15

    There might be many reasons of this error. To fix this issue you can just follow below given step:

    1. Go to product menu of the Xcode, select clean.
    2. If still you are getting the error, then remove the images from your project and again add the images to your project.
    3. while adding image into the project, make sure that you have selected the Project name inside the "Add to targets". And also enable the "Copy items if needed".

    Please Refer below image for better understanding:

    0 讨论(0)
  • 2020-12-01 12:18
    1. Select your image(s) in Project Navigator.
    2. Open the File Inspector.
    3. Make sure you have the target selected.

    0 讨论(0)
  • 2020-12-01 12:19

    Just select the image in Xcode and in right side, File inspector, under 'Target Membership' make sure your project is selected. Another thing you can do is delete and re insert your image and make sure 'Copy items if needed' is selected and 'Add to targets' your project is selected.

    0 讨论(0)
  • 2020-12-01 12:19

    For those that are getting this error while developing a cocoapod

    I was trying to use an image from my pod's bundle, thats inside a .xcassets file, in the storyboard. It would show fine in the storyboard but when i ran the app it would crash saying it cant find the resource.

    I changed my podspec to include s.resources as well as s.resource_bundles

    s.resource_bundles = {
      'SDKRes' => ['SDK/Assets/*']
    }
    
    s.resources = ['SDK/Assets/*.{xcassets}']
    

    Then it was able to load the resource properly from the storyboard

    0 讨论(0)
  • 2020-12-01 12:19

    My case is difference. I have more one assets folder. So I added to the wrong one. Just remove and add to the right.

    0 讨论(0)
  • 2020-12-01 12:21

    You can try opening your storyboard or nib as Source Code and then "Find" the image name in it, see if it exists but already invalid in your project, probably you have deleted or changed its name, and now it doesn't seem valid.

    0 讨论(0)
提交回复
热议问题