Vishwas Singh
Vishwas Singh

Reputation: 1657

Xcode 9 Storyboard: an internal error occurred. editing functionality may be limited

When I am opening my project in Xcode 9, getting above error for Storyboard and Launchscreen.

Note: Cleaning derived data didn't help me.

Please have a look at the screenshot.

enter image description here

Upvotes: 35

Views: 25809

Answers (27)

mikkoata
mikkoata

Reputation: 21

I had the same issue. Very old project and UI builder showing just boxes and giving the scale must be > 0 error. Had some old graphics in the UI with less than 72 dpi. Deleted those / replaced them with 72 dpi or more and voila. Instantly everything was OK. Did the usual delete derived data and reboot and and and but this was the cure.

-> Check images less than 72 dpi and repair them.

Upvotes: 0

Haseeb Javed
Haseeb Javed

Reputation: 2054

Step 1) Open storyboard as source code as shown below: enter image description here

Step 2) You will see this line on top, change version="3.0" into version="3.5"

<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">

3) Step 3 Restart Xcode.

Hope this will help you.

Upvotes: -1

John ives
John ives

Reputation: 1

Quit Xcode and reopen it without using Rosetta and everything will be OK.

Xcode screenshot

Upvotes: -1

Alvaro Franco
Alvaro Franco

Reputation: 656

I had this problem using Xcode 12.2

Some time after adding a UITabBarController to my storyboard, I started getting this error. Checking the log provided by Xcode, I figured out that it was related to the tab bar controller, specifically because it's not supported as detail view for split view controller. Weird, because I didn't use split view controller.

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

Failed to update scene 'ihF-5r-7AU, uvd-WH-zGG, Tgo-fH-4sa, ExD-dD-O6v, BUC-1K-8XU, and SVS-tP-wFU' with IBLayoutConstraint (x120), IBUIViewAutolayoutGuide (x6), UIButton (x3), UIImageView (x2), UILabel (x14), UINavigationItem (x5), UITabBarItem (x2), UITableView (x3), UITableViewCell (x2), UITableViewCellContentView (x2), UIView (x15), and UIViewController (x6).

Exception name: NSInvalidArgumentException
Exception reason: UITabBarController is unsupported as viewController for -[UISplitViewController setViewController:forColumn:] in Primary column

Finally, as someone pointed out, I checked the storyboard source code and found a few splitViewMasterSizeMetrics tags, one tag per tab from my tab bar controller. I deleted those tags and worked like a charm. I don't even know how that split view references were added as I've never used it on my project

So my take would be:

  1. check your log
  2. if you can't still figure out the problem, search on the storyboard source code for any occurrences related to the error

Upvotes: 0

ibyte
ibyte

Reputation: 471

I faced the same problem and error in my storyboard today. One of my controllers was showing nothing but a black background and blue outlines.

I fixed this as follows

  1. Create a new controller
  2. Copy views from the old (dysfunctional) controller to the new controller
  3. Connect views to their respective outlets in the .swift file. (Constraints weren't lost when I copied the views from the old to the new controller)

Upvotes: 0

Genevios
Genevios

Reputation: 1145

enter image description here

The same problem, Xcode Version 12.0 (12A7209). Apple from Xcode 9 to 12 didn't fixed no one problem with Storyboard.

Solution: Just Re-open your project.

Upvotes: 0

muego
muego

Reputation: 21

Check image density. Change to 72dpi or more.

Upvotes: 2

MrHim
MrHim

Reputation: 421

For all others that is facing to this problem and had no luck deleting derived data, it seems there is a bug when you try to add aspect ratio between a element and superview. So when you add aspect ratio constraint and then after you change the second element in the inspector to superview, the constraint is still in the element hierarchy but it should be moved to view hierarchy or, better, add the aspect ratio constraint dragging from element to superview and selecting equal width.

Upvotes: 0

M Murteza
M Murteza

Reputation: 1744

Just Quit project and again open Story Board will ok with all the design controls. In my case .

Upvotes: 0

raeldor
raeldor

Reputation: 483

Just FYI, I got this answer and in the log it said...

Exception name: NSInternalInconsistencyException Exception reason: scale must be > 0

The reason turned out to be that I'd been converting to dark mode and making my button etc. icons using Image Assets. It turned out that I had a tab controller and the pages it was pointing to did not have their icons set to asset catalog images yet.

Upvotes: 0

Tarun Seera
Tarun Seera

Reputation: 4412

I was getting same issue in Xcode 10.2.1

I have open interface builder (Story board) as source code just like attached screen shot by right click on storyboard file

enter image description here

Followed below steps

  1. Updated version 3.0 to 3.5 <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0"
  2. Open storyboard as interface builder again

Its get refreshed now and I was not getting error now and view was proper also

However when I revisted the spruce code of story board the version reverted to 3.0 again.

But this worked for as refresh and resolved my problem

Upvotes: 8

Amrutha Tamanam
Amrutha Tamanam

Reputation: 13

I had the same issue today

Xcode 10.1 ; Quit Xcode & Restarting Mac Book fixed this issue for today,

Upvotes: 1

Besfort Abazi
Besfort Abazi

Reputation: 383

I also had this issue and I tried most solutions provided here.

In the end, what helped me was quitting Xcode (Version 10.1) and restarting my MacBook.

Upvotes: 0

ceekay
ceekay

Reputation: 1226

For me, Just quitting Xcode and open again solved this issue

Xcode 9.4.1
MacOS High Seirra 10.13.4

Upvotes: 1

RakeshDipuna
RakeshDipuna

Reputation: 1610

Just quit (Forcefully if needed) the Xcode and start again.

Upvotes: 1

Hit_Var
Hit_Var

Reputation: 104

I just resolved the same bug which appear on my xcode 9.3.1 by following below step,

  1. Clean the projects
  2. Quit the xocde
  3. Removed BUILD folder from project folder
  4. Open again

Upvotes: 0

zeshan musawar
zeshan musawar

Reputation: 99

Trash derived data by two ways either by command or Preferences.

rm -rf ~/Library/Developer/Xcode/DerivedData/

or

Xcode -> Preferences -> Location -> Derived Data

screenshot 1

In Xcode menu go to product clear the project.

screenshot 2

Disconnect connected device and restart Xcode and system.

screenshot 3

More: https://www.e-learn.cn/content/wangluowenzhang/266937

Upvotes: 6

Ted
Ted

Reputation: 23746

Xcode 9.3

Empty Storyboard/ new project

macOS High Sierra 10.13.4

For my case, this happens when I open a storyboard from a workspace.

So I got rid of workspace and cocoapods. Then just use xcode projects and carthage for thirdparty libraries. Storyboards open faster and without this error.

Upvotes: 0

Sumit Dixit
Sumit Dixit

Reputation: 21

Mostly this error occurred when you have open 2 different version of Xcode. Solution: Please close both Xcode and clear drived data.now again try, use one Xcode at a time

Upvotes: 2

amit
amit

Reputation: 425

I have also faced this issue. Solution is very simple just delete the derived data of xcode and restart the xcode.

Upvotes: 1

Ketan Parmar
Ketan Parmar

Reputation: 27438

When it was happen to me at that time I have configuration was like,

OS : macOS Sierra Version 10.12.6 Xcode : 9.0

I have created new project and open storyboard and this error was there.

Solution : I just quit the xcode and start again and error was not that.

So, it's just requires restart of xcode!

Upvotes: 3

Nauman Malik
Nauman Malik

Reputation: 1346

You can find the issue in Problem Report, just clink on report a bug and open the log.txt file where you can find the issue. In my case i set invalid table row height.

enter image description here

enter image description here

Upvotes: 24

brainray
brainray

Reputation: 12884

After quite some tries I was able to fix it here. Xcode-select was pointing to a wrong version of Xcode (here pointing to Xcode 8.3.3).

To check, use

xcode-select -p

To change, use

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

The problem seems to occur when using a Xcode 9 instance while xcode-select points to a Xcode 8 version. In case you need to use Xcode 8.x again, don't forget to switch back.

Upvotes: 3

Jeremy Huddleston Sequoia
Jeremy Huddleston Sequoia

Reputation: 23651

This error is a general error when something goes wrong with Interface Builder. Unfortunately, the error itself does not point to a specific cause. It is sometimes an error in the tools, sometimes an error in the OS, sometimes an error in developer code, and sometimes an error in user configuration.

Common causes include:

  • Incorrect permissions / ownership set on files.
  • Manually deleting files in ~/Library/Developer.
  • Installing buggy 3rd party kexts (especially security or firewall software).

Upvotes: 0

user4226071
user4226071

Reputation:

I faced the same issue. And solved by updating Command Line Tools and/or deleting unused/older Xcode versions,

Go to Xcode Preferences > Locations,

  1. Update Command Line Tools to Xcode 9.0
  2. Delete derived data
  3. Additionally, delete older Xcode versions
  4. Restart Mac

Upvotes: 0

Vishwas Singh
Vishwas Singh

Reputation: 1657

I fixed this issue by-

  1. updating my Mac to MacOS High Siera
  2. deleted Xcode
  3. installed new Xcode from AppStore

Upvotes: 0

lostInTransit
lostInTransit

Reputation: 71037

This generally happens when you have a compiler error in the code that the editor can't figure out or handle. So it crashes. Unfortunately, the only way to fix this is to find out the piece of code and fix it.

I had this when Swift could not figure out the type for one of my variables.

This answer is worth checking out as well.

Upvotes: 3

Related Questions