Reputation: 1657
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.
Upvotes: 35
Views: 25809
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
Reputation: 2054
Step 1) Open storyboard as source code as shown below:
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
Reputation: 1
Quit Xcode and reopen it without using Rosetta and everything will be OK.
Upvotes: -1
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:
Upvotes: 0
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
Upvotes: 0
Reputation: 1145
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
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
Reputation: 1744
Just Quit project and again open Story Board will ok with all the design controls. In my case .
Upvotes: 0
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
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
Followed below steps
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0"
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
Reputation: 13
I had the same issue today
Xcode 10.1 ; Quit Xcode & Restarting Mac Book fixed this issue for today,
Upvotes: 1
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
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
Reputation: 104
I just resolved the same bug which appear on my xcode 9.3.1 by following below step,
Upvotes: 0
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
In Xcode menu go to product clear the project.
Disconnect connected device and restart Xcode and system.
More: https://www.e-learn.cn/content/wangluowenzhang/266937
Upvotes: 6
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
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
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
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
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.
Upvotes: 24
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
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:
Upvotes: 0
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,
Upvotes: 0
Reputation: 1657
I fixed this issue by-
Upvotes: 0
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