Anyone can help me something goes wrong with me, I cant see my storyboard View, subview, imageview. All became white and its show error like on storyboard file
"An internal error occurred. Editing functionality may be limited."
I have open my project in xcode 8 and 8.1 beta latest xcode but both have same issue.
Main thing is that this is happening with all project not just one.
For example i am opening new project that is open in xcode 8 and i cant see that storeyboad file. Old project is working fine which are not open in xocde 8 i can see that project and open in xcode 7.3.1. but if i open that in xcode 8 and convert to xcode 8 compatible and this issue happen.
I have the same problem with Xcode.
I resolved it by disabling SIP (System Integrity Protection):
Press Command-R when start hold til logo and loading status appear
Open terminal
In terminal print: csrutil disable
Restart system
I have also faced this issue and resolve it by only follow these steps:-
Go to Xcode -> Preferences
Select Locations Tab
Click on Derived Data arrow.
Trash Derived Data Folder.
Restart System
Automatic Fixed this issue.
May this help you.
They inserted autolayout a few versions ago, exactly for this foreseeable reason. It's highly discouraged to use storyboards without autolayout, if you want to work with size classes, different devices with different screen resolutions, orientations, ecc.
My suggestion is revert the project to previous commit, reopen it with xcode7, add the needed constraint and reopen with xcode8 (you will still have problems, because of the many bugs of the new storyboard but they are mostly fixable).
Another option to keep working with in xcode8 it is to use a "freeform" simulated size from the Size inspector of the view controller and adapt the sizes to the old viewcontroller dimensions, but you will have to manage compatibility with all devices sizes programmatically, as i hope it is already being done. It doesn't anyway guarantee that everything works
There are some bugs in storyboard of xcode 8 so if you are not using autolayout then you should use xcode 7. now as you said in question that you are getting problem to open storyboard in older xcode (i.e. 7.x) that because once you open project in xcode 8 then it's change some configuration of storyboard which are not compatible with older xcodes.
So now for solution Open your project in xcode 8 -> open storyboard -> File inspector -> Under Interface builder document -> select xcode 7.x instead of latest xcode 8 from Open in
It will show popup something like Saving for Xcode 7.x will close your document and data for Xcode 8.0 features will be removed. Click Save and close the xcode 8 and open project in your older xcode (7.x) and you will able to open storyboard as it was before!!!
You can refer below screenshot,
Hopefully Apple will fix issue related storyboard and in newer version of xcode 8 you will able to switch project without messing up your UI! But right now there should be a workaround as i mentioned above! Try it!!
for me I just make all the views in storyboard size to inferred
^^"
Related
I was excited to check out Xcode 11 with my existing xCode project, so I started coding with the latest beta version. Today I wanted to upload my new app update but of course Apple rejected the binaries advising me, to use a GM version of Xcode 11 (not released yet) or the latest Xcode 10 app.
I was able to revert all changes made by Xcode 11 (provisioning profile, etc.) and opened the project back in Xcode 10 but I stuck in an error saying
This version does not support collection view cell content view. Open
this document with at least Xcode 11.0.
I am not able to build, archive or even open the storyboard in xCode 10. I found a single collection view in my storyboard in Xcode 11 which I created using the beta. But also after deleting the entire UICollectionViewController incl. the cells and cleaning the project, I am not able open the storyboard back in Xcode 10.
I've read accepted answer, but it wasn't obvious where to find "property" which could be just switched off or something like.
To make it more clear: you just need to replace all occurencies of collectionViewCellContentView with view in storyboard source code. For example see screenshot:
Next, rebuild and Xcode will remove <capability name="collection view cell content view" minToolsVersion="11.0"/> requirement; or remove it manually if you're using Xcode 10.
Hope will be helpful.
EDIT
Found how to "switch off" using of collection view cell content view, but you'll still need Xcode 11 to open storyboard. Change size to Default in collection view cell prototype size inspector:
Try to open the storyboard file with a text editor and search for the property. Usually when there is a warning, Xcode will show this warning during compile time. See if double-clicking the warning redirects you to the line of code where the problem occurs.
Just go to your storyboard which is not opening. Right click on it , Open it with Source Code and search for the property which is not allowing xcode to open your Storyboard.
Search for the property e.g "collection view content view".
Delete that property block. Now Open your Story board as an Interface Builder.
Note: By Deleting the property you will lost that in your view controller screen. :)
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.
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.
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
Updated version 3.0 to 3.5 <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0"
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
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
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.
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.
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!
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
Check image density. Change to 72dpi or more.
I have also faced this issue.
Solution is very simple just delete the derived data of xcode and restart the xcode.
Just quit (Forcefully if needed) the Xcode and start again.
For me, Just quitting Xcode and open again solved this issue
Xcode 9.4.1
MacOS High Seirra 10.13.4
I had the same issue today
Xcode 10.1 ; Quit Xcode & Restarting Mac Book fixed this issue for today,
I fixed this issue by-
updating my Mac to MacOS High Siera
deleted Xcode
installed new Xcode from AppStore
I faced the same issue. And solved by updating Command Line Tools and/or deleting unused/older Xcode versions,
Go to Xcode Preferences > Locations,
Update Command Line Tools to Xcode 9.0
Delete derived data
Additionally, delete older Xcode versions
Restart Mac
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).
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.
I just resolved the same bug which appear on my xcode 9.3.1 by following below step,
Clean the projects
Quit the xocde
Removed BUILD folder from project folder
Open again
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.
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.
Just Quit project and again open Story Board will ok with all the design controls. In my case .
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.
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.
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
Create a new controller
Copy views from the old (dysfunctional) controller to the new controller
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)
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:
check your log
if you can't still figure out the problem, search on the storyboard source code for any occurrences related to the error
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.
Quit Xcode and reopen it without using Rosetta and everything will be OK.
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.
I Have an iPhone 4 running IOS 7.1.2, since the Xcode-Beta doesn't Support anything lower than iOS 8, I referred to this Answer on Stack : Any way to install app to iPhone 4 with Xcode 8 beta?
So I Followed The Steps, then I made a new Project Connected My iPhone But I get this error:
The Error Image
Keep In mind that it is a stock project. I didn't change anything except the Minimum Deployment version.
Uncheck Use Safe Area Layout Guides option in the File Inspector in Xcode.
You can open the File Inspector by clicking on View -> Utilities -> File Inspector.
Hope it helps!
I found Out that making the app programmatically without storyboards solves the problem temporarily
Here is a before and after of one of my screens after I upgraded to Xcode 8.All I did was open up my main.storyboard and from there, I built and ran my app on my phone.In my version control, I can see Xcode is doing a lot of changes to my main.storyboard just from me opening it. Whenever I delete those changes, I can see what I use to see in Xcode 7.3.1.But, as soon as I re-open interface builder with my storyboard, I see those changes come back into place. Is there something I can do here?
Before Xcode 8
After update to Xcode 8
I had a similar problem with tableview images not appearing once I converted the storyboard file to be Xcode8 compatible. This looks like a bug with Xcode8, so until a bug fix is released, here is a work around:
Open your storyboard in Xcode 8 and choose an initial device view. Make changes as you normally would.
Once you have completed your changes, select the storyboard -> File Inspector -> Opens in -> Select 'Xcode 7.x'.
Select 'Save and Close' when prompted
Your storyboard changes will be saved, and your storyboard will function as it did pre-Xcode8.
When you need to make other changes to the storyboard file, follow these steps again.
XIB or Storyboard set default as older version 7.x and Save and Close. Temporary solution, but works. Don't open again once you have done Save and Close. Otherwise again need follow same steps from begin.
Eh the same problem. I partially managed to fix it in the following way (for Xcode Version 8.1 (8B62))
In the document outline of Storyboard, I clicked on each scene which had the yellow arrow indicating some layout issues (Number 1 on the screenshot)
After this, for each problematic scene, I had to click on "Update Frames" small icon (Number 2 on the screenshot) which fixed all the layout issues per scene.
However one scene in my case was still in crying state after transition from Xcode7 to Xcode8. I had to fix it manually by adjusting constraints or adding missing constraints.
Phew, not nice surprise of XCode8 and Storyboards. If you used AppCode editor, you won't have such problem, since it doesn't support Storyboards ;P
Good luck!
Xcode 8.1 Beta 2 resolves this issue. Please check this download link
https://developer.apple.com/download/
Please follow the threads for any possible solution:(I believe it happens to many developers).
Xcode 8 GM seed Storyboard issue
Xcode 8 - Previous storyboards getting distorted
(I used anyH anyW width 600) When Xcode updated to Xcode 8 it changed all my ViewControllers size. As a result all the layout was distorted.
Currently I see only 3 solution for the issue (I wouldn't trust on waiting for fix soon).
1.Go for each Viewcontroller and fix it it by Update Frames.
2.Go to the main ViewController Size Inspector -> Freeform -> 600 as most of the controllers are inferred it will change the size for
all of them.(Be careful on the impact of new Features Apple my want
to introduce).
3.Discard the changes in git for the storyboard (I would't suggest it because Apple also inserted some updates which may be important to
Xcode).
Additional link for the new AutoLayout features in Xcode 8 (WWDC16):
Making Apps Adaptive, Part 1
In my case works solutions suggested by Akhil Kateja and I also need to reset Width and Height of the main view:
1) Set View Size to Free Form
2) Reset Width and Height of the view to the original size:
Finally save and you are done.
For me the solution was simply to click on the UIViewController having issues and then Editor > Resolve Auto Layout Issues > All Views In ... > Updates Frames
It re-arranged the views to fit the existing constraints based on the newly selected default view (iPhone 7 in my case).
Also note: if you get a Navigation Bar Misplaced View warning like I did, simply select the UINavigationController/UIViewController and then Attributes Inspector > Bar Visibility > Shows Navigation Bar - toggle it OFF and then ON again.
Setting View Size to Freeform from Inferred worked for me. It can be found under the heading Simulated Metrics in Attributes Inspector.
I had the same problem and I've solved it by force update the controller's view constraints. Put the following code in your viewDidLoad() function
self.view.layoutIfNeeded()
I selected each controller and clicked on "Update Frames" and it fixed the layout.
The answer from #david-truong (https://stackoverflow.com/a/39589860/1407528) is not working in my case, so if you are in my same situation, try this:
Download the previous Xcode 7.3.1 from here: https://developer.apple.com/download/more/
Undo all your changes (if you have a code manager like git. If you don't, you should 'https://githowto.com/')
Open the project with Xcode 7.3.1.
In the case you have all your devices updated to iOS 10+, this version of Xcode will not recognize those devices as compatible devices. So, try with this trick:
Go to: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Copy the folders related with iOS 10 or 10.1 to: /Applications/Xcode 7.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
Open the project with Xcode 7.3.1 (restart Xcode if you have it already opened)
Select your connected iOS 10+ device
Push Run
Note: New features like Swift will not be available using this trick, but you should be able to load and build your project.
Hope this will help
When i updated Xcode from 7.3 to Xcode 8 and run the app, some of the views are perfectly displayed but some are distorted.Then, i checked the nib file and it prompted me to choose particular device size and then show the nib according to that device size which is offcourse not Any-Any(Xcode 7.3). So all the nibs file are not displaying in a correct way.
Solution work form me :- press the yellow arrow like showing in image below
it will prompt a pop up which show options like
choose Update Frames with Apply to all views in container checked.it will solved around 90% of distorted UI and rest of the auto-layout constraints problem can be solved manually.
I fixed the issue using the Xcode Version 7.3.1 you can download the .dmg file from apple developer portal. I used the Autoresizing in every app and it works great for me.
i will update to Xcode 8 only if they can fix this bug.
Download it here: https://developer.apple.com/services-account/download?path=/Developer_Tools/Xcode_7.3.1/Xcode_7.3.1.dmg
To fix a similar problem, I configured the xib as Freeform (not Inferred) AND saved xib file as Xcode 7.x compatible. Both steps were required in my case. I hope that helps!
I notice one new button in Xcode 8.2, (check the orange circle in the image). It will give you some help.
Steps:
1. Open the storyboard and select any device you want
2. Just select the View Controller
3. Click the mentioned button (as in Image)
4. It will updates the frame for that view controller and you can proceed with it
I didn't found any better solution than this. Please reply if found one.
update constraints and layout subviews in viewdidload solves the problem
- (void) viewDidLoad {
[self.view updateConstraints];
[self.view layoutSubviews];
[super viewDidLoad];
}
I installed Xcode 6.3 which includes support for Swift 1.2. It turned up a ton of error messages, which are mostly casting issues.
I navigated to the storyboard, and cannot go back to any other .swift without the whole thing crashing. I have force quit, restarted, and even re-installed, and I still can't navigate away from the Main.storyboard file.
I have tried the suggestion described here to open storyboard as code, make some changes, revert those changes, save and try again, and still no luck.
Is something in my code breaking Xcode? Is anyone else experiencing this? I had used Xcode 6.3 beta successfully with the same codebase.
Update:
This has now been fixed in Xcode 6.3.1 released on the 21st of April 2015.
I gather from the apple developer forums that this is an #IBDesignable issue. Especially in projects that use custom fonts, additional xibs, etc.
I have somehow fixed my issue by removing all #IBDesignable from swift UIView class definitions. You can open your project directory with TextMate or other, search and remove all "#IBDesignable"
However I still think this is a MAJOR bug, that needs to be worked on.. so keep filing bug reports to Apple.
A temporary solution:
By opening a "New Window" (same project).
One for the code, one for the storyboard or reduce first, work freely with second window.
You can keep your #IBDesignables
EDIT : Bug fixed -> Update Xcode 6.3.1
Launching Xcode while holding shift fixed it for me.
(This suppresses Xcode's state restoration.)
Update: Xcode 6.3.1, released today, resolves this issue.
Update
Xcode 6.3.1
For me, everything works !
Temporary solution:
If you have currently opened Assistant Editor switch to another file using alt+click. You can keep your #IBDesignables.
Here's how I get around this strange bug:
Before launching Xcode, rename the storyboard file in finder so that Xcode won't find it (e.g. add the extension .temp)
Launch Xcode - works fine even if it hanged before since it cannot display the storyboard editor
Open a new window in Xcode
Rename the storyboard file to its original name
In the new window in Xcode - select the storyboard - Xcode does not hang
Minimize the new window and work as usual in the original window. Now you can select any file - even the storyboard - without Xcode hanging
One problem remains, though, at least for me. Every time I select a file or edit something, Xcode needs to recompile the storyboard. Haven't solved that one yet.
I can confirm this bug. I was stuck in storyboard and could do nothing to get out of it (couldn't even open the assistant). As a workaround, with the storyboard open, right-click the .storyboard file and select Open As - Source Code. This will switch your storyboard to code and you will be able to then switch to any file.
It is not a bug anymore since Apple fixed it in Xcode 6.3.1.