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

后端 未结 20 1027
半阙折子戏
半阙折子戏 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:37

    After you make the necessary changes, change the storyboard or in my case a .xib to open in "XCode 7", save and close. This is just a stop gap measure to address the errors but ultimately you will need to fix them or do this until you are no longer able to.

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

    I solved the problem by doing the following:

    1. Go to File > Workspace settings.
    2. Click the little right arrow beside "Derived data". This opens the Finder app at the location of the DerivedData folder.
    3. Go inside the DerivedData folder, and delete the folder corresponding to your project.
    4. Quit Xcode, and re-open it.
    5. Clean your project shiftcommandk.
    6. build your project commandb.
    7. Open your storyboard.
    8. Go to Editor > Refresh all views.

    Updated

    Sometimes just directly Go to Editor > Refresh all views worked. If Refresh all views is disabled, quit Xcode and try again.

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

    When i debugged this i found out there are some classes which are modifying UI. Typically marquelabel which is a subclass of UILabel or any other class subclassing UIView and drawing ui at run time and colliding with Autolayout engine. Try giving fixed width or height for these custom views. If it doesn't solve your problem try Following solutions:-

    Solution 1: - Uncomment #use_frameworks inside your pod file.

    Solution 2: - Try deleting derived data

    1. Close Editor window of your Xcode and quit simulator ->
    2. Go to Xcode Preferences -> Locations ->
    3. Click small grey arrow showing derived data path ->
    4. Select your project ->
    5. Delete all the folders inside ->
    6. Quit Xcode and reopen
    0 讨论(0)
  • 2020-11-27 10:41

    If you're using xib file for custom uiview. Try this:

    Change from

    Bundle.main.loadNibNamed("UserView", owner: self, options: nil)
    

    To:

    let bundle = Bundle(for: UserView.self) 
    bundle.loadNibNamed("UserView", owner: self, options: nil)
    
    0 讨论(0)
  • 2020-11-27 10:42

    In my case, I was using a library which was subclassing UIView. It was using IB_DESIGNABLE, and was missing call to [super awakeFromNib]. Once I've added the call to this method, the bug went away.

    I'm not sure if the fact that it was implementing IB_DESIGNABLE had an impact in this.

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

    I faced this issue in CocoaPod 1.5.0. The solution is to reinstall pod again (pod install again) once this error showing or you may use CocoaPod 1.4.0 instead. It works fine in 1.4.0 (at least for me.)

    update:

    Add following script in Podfile help me solve the issue in 1.5.0

    post_install do |installer|
      installer.pods_project.build_configurations.each do |config|
        config.build_settings.delete('CODE_SIGNING_ALLOWED')
        config.build_settings.delete('CODE_SIGNING_REQUIRED')
      end
    end
    

    reference: https://github.com/Skyscanner/SkyFloatingLabelTextField/issues/201#issuecomment-381915911

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