Could not find a storyboard named 'MainStoryBoard' in bundle NSBundle

前端 未结 27 2565
感动是毒
感动是毒 2020-12-02 15:41

I have started a new app a few days ago and began working with the simulator to test it. I started as an empty project and manually added the storyboard. The simulator build

相关标签:
27条回答
  • 2020-12-02 15:51

    The simulator is not case sensitive, but the device is. If your storyboard is called MainStoryboard, not MainStoryBoard, this will cause your problem.

    0 讨论(0)
  • 2020-12-02 15:51

    Tried all solutions mentioned above but didn’t worked.

    After thorough research found the culprit:

    Copy Bundle Resource was missing from TARGETS -> Build Phases

    This got accidentally removed while removing Cocoapods.

    Below are steps to fix this :

    1. Go to TARGETS of your project
    2. Click on plus (+) button present on top left corner
    3. Select New Copy Bundle Resources from drop down
    4. Now, add you Storyboard files (Main, Launchscreen etc). Also add Assets folder. You can add these files by clicking on plus (+) button present in bottom

    1. Delete the derived data content
    2. Delete the app from Simulator/Device and run again
    0 讨论(0)
  • 2020-12-02 15:52

    I also had same issue, what caused this type of exception is I had written "Main.storyboard" instead of "Main". We don't have to specify .storyboard extension.

    0 讨论(0)
  • 2020-12-02 15:52

    I had this problem when I accidentally opened a project with a second install of Xcode. It broke my project files permanently (which is understandable).

    0 讨论(0)
  • 2020-12-02 15:52

    Go to your info.plist on Build Phases > Copy Bundle Resources and add your storyboard using the icon "+"

    0 讨论(0)
  • 2020-12-02 15:53

    I had this error on the device when I added about 150 fonts to UIAppFonts.
    After I reduced their count to about 100, it went away.

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