Xcode 8 - IB Designables - Failed to render and update auto layout status, The agent crashed

后端 未结 20 1026
半阙折子戏
半阙折子戏 2020-11-27 09:55

I recently upgraded to Xcode 8 and I am having issues with the Storyboard.

If I open the project and I don\'t have the Storyboard open, it will compile and run just

相关标签:
20条回答
  • 2020-11-27 10:25

    I just delete the view that is failed and press command+Z to undo deletion. It works for me.

    If editing the failed view later, the error may occur again, do the above again.

    0 讨论(0)
  • 2020-11-27 10:28

    In my @IBDesignable class crashed because I used the custom class for the color and forced unwrapped the colours propertied that's @IBDesignable class found nil while unwrap

    So you need to find the IBDesignablesAgent-iOS_[Date]_[YourMac].crash on ~/Library/Logs/DiagnosticReports this location and you will get the reason of the crash with the respected file path.

    Now you have to check the respected file.

    0 讨论(0)
  • 2020-11-27 10:29

    I faced this problem after update to latest XCode version .After trying multiple solution described above ,i only quite Xcode and then shut down system and turn it on and that worked for me .

    0 讨论(0)
  • 2020-11-27 10:30

    Try to disable 'Use Trait Variations' (Identity and Type panel) for any xib file that you might have for custom views that are used in your storyboard.

    0 讨论(0)
  • 2020-11-27 10:31

    I had the same issue and came here to try and figure out what happened. I noticed the top rated answer and the answer itself didn't help me, as IBDesignable didn't exist in the log folder and I already attempted all other options there, however in the comments I noticed someone talking about a frame init.

    I decided to try commenting out my IBDesignable extension for UIView and it instantly fixed the problem. So, to fix this, find the extension causing the issue and make sure to set up the required inits by creating an IBDesignable class and providing the required initializers as follows:

    @IBDesignable class RoundedView: UIView {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        sharedInit()
    }
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        sharedInit()
    }
    
    override func prepareForInterfaceBuilder() {
        super.prepareForInterfaceBuilder()
        sharedInit()
    }
    
    func sharedInit() {
    }
    }
    

    IMPORTANT: remember to add the new class to the item you are using the designable on.

    0 讨论(0)
  • 2020-11-27 10:34

    my problem was solved by deleting folders (which is related to this project) from derived data folder. you can do this by clicking File -> Project Setting -> then click the arrow sign deside /Users/.../Xcode/DerivedData click DerivedData folder you will see your project named folders delete those . quit xcode the open your project , clean the project by using this step Product->clean then build the project : Product->Build These will resolve this problems .

    0 讨论(0)
提交回复
热议问题