Xcode crash on opening storyboard - ios

I am developing an app for iOS with Xamarin. Lately, I haven't been able to access my storyboard file in Xcode or compile my app anymore because Xcode crashes right away when opening the .storyboard file.
The error message is the following:
ASSERTION FAILURE <br>
Details: Creating an out of band arbitration unit with a view (<IBUITableViewCell: 0x7fa88d13a5d0>) as the root under another view (<IBUITableView: 0x7fa88cf000e0>) is not yet implemented.<br>The view would need to be in two arbitration units, the one above for positioning constraints, and the root of the one below for sizing constraints. <br>But then that means that subviews cannot have constraints that affect the size of the view, so the view must have ibExternalTranslatesAutoresizingMaskIntoConstraints set to YES.
<br>Object: <IBUITableViewCell: 0x7fa88d13a5d0>
<br>Method: -ibArbitrationUnitWasCreatedWithReceiverAsRootUnderParent:
I tried rebasing my storyboard to the last version that worked (the one the app was submitted to the app store) and weirdly, even that version didn't work.
My plan was to manually remove and every view controller and add them one by one to figure out where the error is.
However I don't understand why XCode crashes when opening the storyboard and not just shows me exactly where the error in my xml is.
So if anyone has encountered this problem before and has a better way to fix it than to manually do it, I would really appreciate any help.

ibExternalTranslatesAutoresizingMaskIntoConstraints needs to be YES
Sounds like the Storyboard was created with an older Xamarin.iOS that introduce this issue.
The fastest solution is to open the storyboard in vi (or Xcode / View As Source, or another text editor of your choice, and replace all translatesAutoresizingMaskIntoConstraints="NO" with "".
Save the file, re-open it in the Storyboard editor and fix your contraints.

Related

iOS designer not rendering storyboard

In the Xamarin.IOS editor I get this error:
"There was a problem parsing the XML in this document"
System.NullReferenceException: Object reference not set to an instance of an object
at MonoTouch.Design.ProxiedView.set_UseSafeArea (System.Boolean value) [0x00001] in /Users/vsts/agent/2.154.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Shared/ProxiedView.cs:944
at MonoTouch.Design.ProxiedViewController.UpdateLayoutGuides (MonoTouch.Design.Catalog utilityCatalog, MonoTouch.Design.IosDocument rootModel) [0x002ac] in /Users/vsts/agent/2.154.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Shared/ProxiedViewController.cs:238
at MonoTouch.Design.Storyboard.UpdateLayoutGuides (MonoTouch.Design.Catalog utilityCatalog) [0x00017] in /Users/vsts/agent/2.154.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Shared/Storyboard.cs:132
at MonoTouch.Design.Client.IPhoneDesignerSession.LoadXml (System.Func`1[TResult] getDoc, System.Boolean shouldTryUpgrade, System.String fileName) [0x00310] in /Users/vsts/agent/2.154.3/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client/IPhoneDesignerSession.cs:466
I tried disabling things and retracing every step I made doing the storyboard, the only thing that half worked was disabling autolayout, but it destroyed my layout.
The thing is that it works perfect in the app and xcode but in the VS iOS designer it doesn't work, and I need it to add the ids of the components to use them my ViewController, in my project it's the only way to add ids.
I´m lost, if you need any extra info ask me, I pasted the important (or so I think) part of the logs, they were too long.
This is the iPad version of a storyboard that works perfectly, it was based of that storyboard (copied and pasted then edited to fit with iPad)
This is the storyboard: https://pastebin.com/QAHEBne0
The problem with your file was that somehow you have constraints related with the safeArea but it was not turn on in the file.
I fix it when I open the file in my Xcode and just turn in on(check the image)
the result is useSafeAreas="YES" added to document tag on the second row in your xml
Please, check your constraints carefully it is possible some of them to be broken or deleted.

IB Designables: Failed to render and update auto layout status - The agent crashed

I am working on an existing iOS Project in Xcode 10.2.1 on macOS 10.14.4. The uses mainly Objectiv-C but also some Swift Pods (v. 1.5.2). Recently I have also added the first Swift based ViewController using Swift 5.
The Problem:
When working on the XIB file of this Swift bases ViewController after a short time the following error message is shown in the Xcode sidebar:
IB Designables: Failed to render and update auto layout status for
ViewXYZ (abc-de-123): The agent crashed
As soon as there error occur no changes in the Interface Builder (added view, changed colors, text, etc.) are shown anymore. When I re-open the XIB file it only show grey view placeholders instead of the real content.
The problem can only be solved by re-starting Xcode but when working on the XIB again it shows up after again after just a few moment.
Things that did NOT work
Since the problem is realted to IB Designabales I checked these first. Within the ViewController I am using two different custom views which are implemented in Objective-C and marked as IB_DESIGNABLE.
These views have not been changed recently and it was never a problem to use them before. Removing all custom code from these views did not change the problem. Thus there seems to be nothing wrong with the implementation.
I found other topics dealing with similar issues, but none of the different solutions worked for me:
Re-starting the Mac, re-starting Xcode, cleaning the build folder or deleting ~/Library/Developer/Xcode/DerivedData does NOT solve the problem
Adding this code to the pod file does NOT solve the problem
Adding all UIView constructors to the views as proposed here does NOT solve the problem.
Xcode shows that the designables are up to date and does NOT offer a debug button (as shown here)
The views do not have orphant outlets
Re-creating the XIB from scratch let to the same issue
Not using the Bundle or other device specific code within the custom views did NOT solve the problem. As described before I removed ALL custom code from the classes so that they where simple UIView subclasses without any changes.
So far nothing I tried had any effect. However, most answers I found are quite old. Are there are any new proposals to solve this issue?

uiview deleted from storyboard is still showing

I have a very strange behavior in my ios app, if I go to the storyboard and delete the UIImageView object and then run the simulator it still show the image.
Any ideas?
I know why you don´t believe me, I didn´t beleive it either when I saw it, but I just found what(not why) was hapening: the problem was that I messed with the main storyboard configured in the project->info, somehow it was calling the old storyboard and i say somehow because there was no file with that name, it was not enough to change the property to the actual storyboard file, I needed to create a new one.

Storyboard crashes Xcode when opened

Whenever I attempt to open up my storyboard, Xcode crashes with the following error report
The funny thing is, the app works fine in the simulator and builds without errors. What is causing this crash? I see two possible crashes:
Exception reason: UITableView dataSource is not set
, but that shouldn't make the storyboard crash right?
Details: Failed to compute auto layout status IBLayoutConstraint, IBUIButton, IBUIDatePicker, IBUITextField, IBUIView, IBUIViewController, and IBUIViewControllerAutolayoutGuide.
Which doesn't give much information at all.
I have been using a storyboard with Xcode 5 for some time, so the question does not appear to be related to moving from Xcode 4 to 5. I can open the storyboard as XML and I can open my iPhone storyboard just fine.
If you are using git, I would recommend reverting to a time before this problem started.
If you are not using git, and you are absolutely sure you did not edit the xml for the storyboard then I would say:
1)find the storyboard file using the finder.
2)copy it to your desktop.
3)go back to Xcode and delete the storyboard from your project, select "move to trash". 4)re-import the storyboard file into your project.
Ive had similar problems with Xcode 5 and either reverting using git or the steps above usually get me back up and running.
Exception reason: UITableView dataSource is not set
Details: Failed to compute auto layout status IBLayoutConstraint, IBUIButton, IBUIDatePicker, IBUITextField, IBUIView, IBUIViewController, and IBUIViewControllerAutolayoutGuide.
The errors described above lead me to think that one if not all viewcontroller(s) for the items listed above lost their connectivity to viewcontroller.h / viewcontroller.m files. I would make sure you have everything wired up correctly, and you can check this by making sure the items in your viewcontroller have a circle in the gutter (next to the line numbers) that is filled in (solid) if the circle is not filled in then it means your items are not wired up to your viewcontroller. I would post a picture of your .h / .m file of your viewcontroller so we can further investigate.
I ended up copying each view controller scene (in XML) into a new storyboard. Some view controllers could not be copied without the storyboard crashing so I had to recreate about 4 of them, but by and large I got the majority of my work back.
What you need to do is reopen the project again in Xcode 5 and then go to the storyboard. Then at the right side choose for "Identity and type" and then set "opens in" to Xcode 4.6 to be able to open it in Xcode 4.6. And disable auto layout, somehow when you open it in xcode 5 it asks you to update it, I think you did that without a thought, happened to me as well :)

Linking Storyboard View with Costum View Controller?

i am fairly new to IOS programming, and i am having small issues linking the view inside the storyboard with the ViewController i creat.
I can do it programmaticly, by editting the storyboard source, but i cannot seem to do it via the interface.
<viewController title="Navigation" id="2" customClass="ViewControllerNav" sceneMemberID="viewController">
works, but if i go in to the interface and set the Costum class to ViewControllerNav, nothing happens, and i get a error on compile?
(It dosnt even show up when i start typing "ViewContr...." etc, its like the class is not registerd there)
I had the same problem and deleting the XCode cache has fixed this for me (assuming that IB can't see your class when you type it's name). Firstly quit XCode, then delete the cached files by deleting all of the contents of this folder /Library/Developer/Xcode/DerivedData
Doing this and then opening xcode again should fix the problem
Close out xcode and re open i bet it will magically be there. Seriously though, if you can type in custom class in storyboard source then theres nothing wrong with your code, you should even be able to type it into where you type in custom classes, just sometimes after freshly creating it, it wont show.

Resources