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?