Could not find a storyboard named 'Main' in bundle

前端 未结 24 1418
无人共我
无人共我 2020-12-01 00:26

I\'m getting a strange error: \'Could not find a storyboard named \'Main\' in bundle NSBundle\' when trying to run my app on a real iOS device.

I have

相关标签:
24条回答
  • 2020-12-01 00:58

    Select the view controller you want to first show up in the list on the left side of the storyboard, then in the attribute inspector make sure its title is "Main" and the checkbox for "Is Initial View Controller" is selected.

    0 讨论(0)
  • 2020-12-01 00:59

    In a project that uses UIScene in iOS 13 and Xcode 11, you need to remove the UISceneStoryboardFile key from the .plist.

    Xcode 11:

    Changing directly from the file:

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

    You may check the target membership of the storyboard. May be there is where the problem is:

    It should be looking like this:

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

    An update for applications created for iOS 13.0 and above. (Xcode 11)

    If you get the error "Could not find a storyboard named 'Main' in bundle even after changing the "Main storyboard File base name" in the info.plist and "Main Interface" under Deployment in Target.

    Then you have to change another entry in the info.plist file.

    1. Open the info.plist file.
    2. Expand "Application Scene Manifest".
    3. Expand "Scene Configuration".
    4. Expand the item 0 under "Application Sessions Role" and then change the storyboard name there.

    And your application will start working.

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

    Deleting row in plist caused black screen in my app too. And I fixed it by enabling target membership of the storyboard

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

    If your storyboard is added in project (which you'll determine from Project File Inspector section of xcode utility area)

    You just have to remove Main.Storyboard from "Copy bundle resource" (in Build Phase) and add it again in "Copy bundle resource". This was worked for me.

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