xcode 9 crash when open storyboard

前端 未结 14 1991
说谎
说谎 2020-12-09 15:05

XCode 9 GM Candidate 1 is currently crashing when opening a storyboard.

ProductBuildVersion: 9A235

UNCAUGHT EXCEPTION (NSInternalInconsistencyExcepti         


        
相关标签:
14条回答
  • 2020-12-09 15:45

    I found a solution for my case. It was crashing from the UITabBarViewController.

    1. Open the storyboard as source code
    2. Search for your UITabBarViewController
    3. Remove the tab bar
    4. Open storybard as Interface builder
    5. Create new tab bar and connect the root view controllers you need

    As Michele Schillaci said, you can try to remove some view controller and check if that solved the problem.

    0 讨论(0)
  • 2020-12-09 15:47

    I'm getting a similar issue. In my case, I've found that it consistently crashes when opening via the file explorer, whereas opening via Open Quickly (CMD+SHIFT+O) does not cause XCode to crash.

    0 讨论(0)
  • 2020-12-09 15:47

    Try to open another project's ".storyboard" and then go back to the project which is making Xcode crash!

    I had this exact problem with Xcode 9.1 (9B55) on a project which was ok yesterday. Today when I tried to open any ".storyboard/.xib" file Xcode was crashing!

    As some people suggested I removed all "<nil key=..." tag contents. It worked but meanwhile I had opened another project's storyboard. Then I restored all my changes and it worked again.

    This seems not caused by the "<nil key=..." tag contents but by some weird state in which Xcode becomes.

    0 讨论(0)
  • 2020-12-09 15:50

    There is a known bug with tab bars containing system tab bar items. The Xcode 9.1 release notes acknowledge this, and suggest a workaround:

    Interface Builder

    A UITabBarItem configured as a system item in a storyboard or xib causes a build failure. (34197132)

    Workaround: Configure as a custom item in Interface Builder, then reset the tab bar item to the desired system item in the awakeFromNib method of the view controller.

    0 讨论(0)
  • 2020-12-09 15:58

    Easy fix:

    Just put insetsLayoutMarginsFromSafeArea="NO" on <tabBar key="tabBar" contentMode="scaleToFill" id="ytw-4N-0RV"> and remove all <nil key ="...."> from your storyboard source code.

    E.g:

    <tabBarController id="mhN-Gc-eXK" sceneMemberID="viewController" restorationIdentifier="tabbar" storyboardIdentifier="tabbar" customClass="TabbarMainViewController">
        <tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="ytw-4N-0RV">
            <rect key="frame" x="0.0" y="0.0" width="320" height="49"/>
    
    0 讨论(0)
  • 2020-12-09 15:59

    I replaced this

    <tabBar key="tabBar" contentMode="scaleToFill" translucent="NO" backgroundImage="background_tabbar" selectionIndicatorImage="background_tabbar_item" id="Z9r-yE-1Zs">
    

    on that

    <tabBar key="tabBar" contentMode="scaleToFill" id="Z9r-yE-1Zs">
    

    and Xcode doesn't crash anymore when I try to open the storyboard

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