Error loading Storyboard

Error Code : An internal error occurred. Editing functionality may be limited.

This happens in every project I open, even if I create a new project. Please help.

=================================
DATE:
=================================

Saturday, 8 May 2021 at 7:55:59 PM India Standard Time
2021-05-08 14:25:59 +0000



=================================
XCODE VERSION INFO:
=================================

Version = 12.0 (12A7209)
Plugin Version = 17156
Beta Version = 2
OS Version = 11.2.3 (20D91)



=================================
ASSERTION:
=================================

Failed to update scene 'MCj-i5-HUl' with IBLayoutConstraint (x28), IBUIViewAutolayoutGuide (x1), UIButton (x4), UIImageView (x1), UILabel (x3), UINavigationItem (x1), UIView (x1), and UIViewController (x1).

Exception name: IBPlatformToolFailureException
Exception reason: The tool closed the connection

Application Specific Information:
  • ** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to create remote render context'

terminating with uncaught exception of type NSException
abort() called
CoreSimulator 757.5 - Device: iPhone Xʀ (4676610B-BFA2-4500-A714-A4D0E4BC53CF) - Runtime: iOS 14.0 (18A372) - DeviceType: iPhone Xʀ
Seems you are using an old beta. Download Xcode 12.4 (or 12.5 if you run BigSur)
Can download 12.4 here:
https://developer.apple.com/download/more/
And try open the project.
You should also test that a new project works.

If that's not OK for your project:
  • First make a copy of your project and work on this copy.

  • Can you identify the object : MCj-i5-HUl ?

You could open the storyboard in an editor to search for 'MCj-i5-HUl'
  • Try to remove completely this object, which should remove all constraints

  • Then try to reopen the project

  • And recreate the deleted object.


Hi,

I downloaded & installed Xcode 12.5 but face the same issue. Even when I create a new project, I get the same error. The following is the log from a new project I created, when I opened the storyboard, same issue -



=================================
XCODE VERSION INFO:
=================================

Version = 12.5 (12E262)
Plugin Version = 18122
Beta Version = 4
OS Version = 11.2.3 (20D91)



=================================
ASSERTION:
=================================

Failed to update scene 'BYZ-38-t0r' with IBUIViewAutolayoutGuide (x1), UILabel (x1), UIView (x1), and UIViewController (x1).

Exception name: IBPlatformToolFailureException
Exception reason: The tool closed the connection

Application Specific Information:
ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IBSimulatorComponents/IDEInterfaceBuilderCocoaTouch-18093/SimulatorComponents/IBCocoaTouchTool/IBCocoaTouchTool.m:354
Details: Expecting an object package for incremental session 0DC7D599-A117-4256-BF0B-4BFF7B68B7A0, active sessions = (null), context = (null), last closed session = (null)
Object: <IBCLICocoaTouchTool: 0x7fe5c1f0a1c0>

I note object ID has changed from 'MCj-i5-HUl' to 'BYZ-38-t0r'
Is it a different project ?

Did you find which object has ID 'BYZ-38-t0r'. It is probably a ViewController scene.
Interesting, I checked several projects: their initial scene has the same ID (probably attributed systematically by Xcode) 'BYZ-38-t0r'.
The ViewController has the same ID.

So, the problem is with this initial scene.
Could you describe how it is composed ?
To find, if you cannot search in storyboard, open the storyboard directly in TextEdit.

Please tell and copy the complete XML part for the 'BYZ-38-t0r' object.

Additional question:
  • is it an iOS project (it seems so)?

  • or a Catalyst ?

  • what is the simulator version you use ?

Hi Claude,

It is a different project, a new project that I created with no additions, I just created a new project, went straight to storyboard and bam, the issue was there already. Here is the XML part of this project (it is an iOS project) -

Simulator version is 12.5 (961.1)

<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
  <device id="retina6_1" orientation="portrait" appearance="light"/>
  <dependencies>
    <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
    <capability name="Safe area layout guides" minToolsVersion="9.0"/>
    <capability name="System colors in document resources" minToolsVersion="11.0"/>
    <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
  </dependencies>
  <scenes>
    <!--View Controller-->
    <scene sceneID="tne-QT-ifu">
      <objects>
        <viewController id="BYZ-38-t0r" customClass="ViewController" customModule="SAMPLE_PROJECT" customModuleProvider="target" sceneMemberID="viewController">
          <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
            <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
            <subviews>
              <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="IPf-ol-yH6">
                <rect key="frame" x="200" y="52" width="0.0" height="253"/>
                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                <fontDescription key="fontDescription" type="system" pointSize="17"/>
                <nil key="textColor"/>
                <nil key="highlightedColor"/>
              </label>
            </subviews>
            <viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
          </view>
        </viewController>
        <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
      </objects>
      <point key="canvasLocation" x="95.652173913043484" y="77.678571428571431"/>
    </scene>
  </scenes>
  <resources>
    <systemColor name="systemBackgroundColor">
      <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
    </systemColor>
  </resources>
</document>
Here is what I get from a working project (Xcode 12.4)

<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina6_5" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--First View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController storyboardIdentifier="FirstView" id="BYZ-38-t0r" customClass="FirstViewController" customModule="simpleTest" customModuleProvider="target" sceneMemberID="viewController">


I note the following differences:
toolsVersion="17701" vs "18122" for you
But in your first post, with 12.0 it was:
Plugin Version = 17156, which is anterior to mine.

In my case I also have:
        <deployment identifier="iOS"/>
May be you have included Mac in deployment info ?

In my case:
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
In yours
    <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>

So I would (on a test project):
  • do an option-clean build folder

  • remove Mac deployment (if you did set it)

  • change useAutolayout="YES" to "NO"

You should file a bug report with all this information.

It is a different project, a new project that I created with no additions, I just created a new project, went straight to storyboard and bam, the issue was there already.

I created a new project, opened the Main.storyboard with text editor and replaced the content with the XML you have shown.
I then re-opened the project with Xcode 12.5, nothing happens. Opened Main.storyboard and Interface Builder opened without any problems.
Ran the app, and the simulator started without any issues.

I'm afraid your Mac environment might be broken. Have you upgraded your Mac from an older version?
If so, there may be some remains of old Xcode tools or intermediate builds in your Mac.
Claude : I did all that and checked again, still same issue. Will file a bug report.

OOPer : Yes I am thinking that is most likely the issue since I upgraded Mac OS to Big Sur. How do I go about fixing the Mac environment in case it is broken which it most likely is?

How do I go about fixing the Mac environment in case it is broken which it most likely is? 

Hard to say something sure.
There may be many parts where Xcode would store intermediate something.
But, for example, in my Mac using Xcode, there is no directory /Library/Caches/com.apple.xbs. You may need to find all such directories and try removing them.
(Of course, you should better make backups before trying.)


I found this older thread where exact same problem showed (with the same cache directory).

Solution proposed was:
https://developer.apple.com/forums/thread/123204

having the same crash on XCode 11.2.1 . I went on to "Show package contents" of the ".xcworkspace" workspace directory and deleted "xcuserdata" folder. This resolved the crash for me.

However, in your case it happens for any new project.

So read the full thread, there are other proposed solutions.
I checked the entire thread and tried every single solution proposed, none of the worked for me. I will now try a factory reset of my system and see if it makes any difference.
Okay, so I erased my discs and did a fresh OS install (Big Sur) followed by Xcode 12.5.

Bam, same issue again. Created a new project from scratch, went straight to storyboard and there it was again, the log is below. At this point, I have pretty much given up any hope of solving this issue without help from Apple.


=================================
XCODE VERSION INFO:
=================================

Version = 12.5 (12E262)
Plugin Version = 18122
Beta Version = 4
OS Version = 11.3.1 (20E241)



=================================
ASSERTION:
=================================

Failed to update scene 'BYZ-38-t0r' with IBUIViewAutolayoutGuide (x1), UIView (x1), and UIViewController (x1).

Exception name: IBPlatformToolFailureException
Exception reason: The tool closed the connection

Application Specific Information:
  • ** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to create remote render context'

terminating with uncaught exception of type NSException
abort() called
CoreSimulator 757.5 - Device: iPhone Xʀ (7AFA8D5E-C28E-48EE-A30D-DC82F30208E2) - Runtime: iOS 14.5 (18E182) - DeviceType: iPhone Xʀ

Happy to report that I solved the issue by uninstalling Xcode 12.5 and installing Xcode 11.7. Works without an issue now.
Thanks for the feedback.
Problem is that XCode 11.7 won't let you publish on the appstore.

You should try:
  • change the name of your XCode (11.7) to XCode11 for instance to keep it as a development version.

Then Reload XCode 12 (at least 12.4 or 12.5 if you are curious enough), from downloads/more
Check if it works now.

In anycase, don't forget to close the thread.
Error loading Storyboard
 
 
Q