80

I'm seeing this error for a XIB. But everything else compiles and there doesn't seem to be any harm done by this error. Is this something I need to worry about? What's the problem here and how would I go about fixing this?

enter image description here

UPDATE: I've updated cocoapods to the latest version (0.36.3) and while that fixed the problem for a few compiles, the error has returned and I'm now seeing an additional error:

enter image description here

Oren
  • 5,055
  • 3
  • 34
  • 52
  • https://stackoverflow.com/questions/50644306/ibdesignable-error-failed-to-update-auto-layout-status/52790289#52790289 This will help you – Hardik1344 Oct 13 '18 at 06:55

13 Answers13

80

It is a known issue in CocoaPods. It has been fixed in version 0.36.1. Just update your CocoaPods and then add specific line of code to your pod file: use_frameworks! after platform :ios, '7.0'

So your file will look like this:

platform :ios, '7.0'

use_frameworks!

/// here will be dependencies etc. ///

updated:

Full list of steps to get rid of the problem once and for all:

  • Close project;
  • Open Terminal App;
  • Update CocoaPods itself to ver. 0.36.1 or later;
  • Navigate to your project folder in Terminal;
  • Type: pod update;
  • Open your project in xCode;
  • Clean project;
  • Build project again.
Andrei Konstantinov
  • 6,971
  • 4
  • 41
  • 57
  • 2
    Actually just updating cocoapods seemed to do the trick for me. I'm surprised cocoapods was giving me an error in an unrelated XIB but so it goes... – Oren Mar 11 '15 at 18:03
  • 1
    I take that back. The error has returned. I made the additional changes you suggested and the error still persists and I now also get multiple O-link warnings about iOS8 – Oren Mar 27 '15 at 00:09
  • What if you Clean project via Cmd + K and then Build again? – Andrei Konstantinov Mar 27 '15 at 07:49
  • 2
    Tried that multiple times. no luck – Oren Mar 27 '15 at 16:36
  • Can you check one more time your CocoaPods version via Terminal? – Andrei Konstantinov Mar 27 '15 at 16:41
  • I had 0.36.1. The problem was actually I needed to regenerate the pod project again. Once I did that then the errors went away! Thanks! – Oren Mar 27 '15 at 20:27
  • Geez now the errors are back again! It seems like that's only a temporary solution. – Oren Mar 27 '15 at 20:31
  • I've updated my answer with full list of steps. Can you confirm that you already did this in the same exact order? – Andrei Konstantinov Mar 29 '15 at 08:29
  • I followed your exact steps, including updating cocoapods again (FYI, it's "pod update" for step 5). The error message again went away. But as soon as I opened the offending XIB again the error message reappeared. – Oren Mar 29 '15 at 18:54
  • Maybe it's the problem with specific framework/ UI extension, because my errors all goes away, forever. What is the pod which still brings you the errors? And thanks for edit. Fixed that part. – Andrei Konstantinov Mar 29 '15 at 19:21
  • 1
    You're right. I'm referencing TTTAttributedLabel in my XIB. As soon as I remove that the error goes away. If I put it back, the error returns. I'm not sure what I can do about that now but at least I know the cause. Thanks for your help! – Oren Mar 29 '15 at 22:17
  • I found one more solution, that may or may not help you. You need to check valid architectures of the project. So, they are ended like "arm64 armv7 armv7s". – Andrei Konstantinov Mar 29 '15 at 22:26
  • it seems best solution for now! – Trong Dinh Jan 25 '16 at 05:42
  • 1
    I just added "use_frameworks!" and everything starts working fine with FSCalender. Thanks – Zulqarnain Mustafa Jul 19 '17 at 10:11
  • I had this problem because my pod depended on another. Looks like this issue has been known for a couple years, but no one has had the time to fix it yet: https://github.com/CocoaPods/CocoaPods/issues/5334 – bugloaf May 04 '18 at 17:09
33

After doing some research and digging, I can confirm, that there is no way to solve this problem.

This is an Xcode's bug.

That's all. We must wait for update.

Just restart the Xcode for now.

Khaled Annajar
  • 15,542
  • 5
  • 34
  • 45
Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
  • 8
    that's true. for me it has nothing to do with cocoa pods, it happens with my own IB designables all the time. tried everything... – benjamin.ludwig Jul 21 '15 at 04:53
  • Yes, I didnt use CocoaPods in my app for IBDesignables. – Zeeshan Nov 24 '15 at 09:26
  • 2
    What version of Xcode was this? I'm using 7.1.0, I still have it – CalZone Dec 15 '15 at 20:57
  • i was using 7.2 and just due to your this comment i waited for 7.3 , but the problem is same.. please let me know in case you have some other solution – Kunal Gupta Apr 29 '16 at 07:34
  • Same problem here. This is irritating as i'm using a custom form input view for all my form inputs and as soon as I add one... that's it... no more updating the constraints for me... – Nuno Gonçalves May 18 '16 at 14:54
  • 2
    I'm using Xcode 8.0 this issue is still not addressed. – Statik Oct 19 '16 at 14:31
  • 4
    The interface builder is very slow and buggy. Almost can't be used for Component design. Yes, it's still the same in Xcode 8.0. I think one of the most important reason I enjoy more in ios development than android development is the IDE tool is much better. Apple did very bad job in their xcode tool. It's becoming worse and worse!!! – Bagusflyer Nov 03 '16 at 04:25
  • 3
    I'm on Xcode 8.2, and it's still the same after 1.5 years. Unbelievable. – Can Poyrazoğlu Feb 05 '17 at 23:12
  • Same here with XCode 8.2.1. Also purging derived data or init methods definitions didn't change the situation. In addition in the project there is no pod or carthage or so on – JSBach Feb 22 '17 at 05:05
  • To jest już skandal – Bartłomiej Semańczyk Oct 11 '17 at 08:51
  • This came back with Xcode 13: `Failed to render and update auto layout status for ...: Failed to load designables from path (null)` - for me it's complaining about a color set, even though it exists. At first it threw the error for 3 ViewControllers, so I added a print and deleted it again, which removed it for 2 of them but after trying the same thing for the 3rd VC, the error now also shows up for a 4th. It also started an iPad simulator that I haven't used in a while, even though a different one is selected. – Neph Sep 30 '21 at 13:48
17

This worked for me:

  1. remove derived data (preferences > locations)
  2. restart Xcode
  3. clean project (product > clean)
Wojtek Dmyszewicz
  • 4,188
  • 5
  • 30
  • 42
13

2016 is the year, xCode 7.3.1: I got this error. (Using cocoa pods 1.0 but it does not matter)

CAUSE: a special UILabel subclass was used in IB. ring a bell?

ELEGANT SOLUTION:

1: Subclass TTTAttributedLabel or FXLabel or whatever u have. Use that in IB.

2: Add these lines in the subclassed .h file:

#ifndef IB_DESIGNABLE
#define IB_DESIGNABLE
#endif

@class LabelFromPod;


IB_DESIGNABLE @interface YourLabel : LabelFromPod {
 ...
}

3: then I think you have to clear project, exit xCode, rebuild (usual xCode panic protocol) and the problem will go away.

UPDATE 2017 xCode 8.2.1: It all getting worse :( The blank VC problem: The IB does not even load the UI elements for a view controllers that have these IB_DESIGNABLEs. I'm clueless :)

Yaro
  • 1,222
  • 11
  • 15
  • 1
    The errors will still occur randomly. Quitting Xcode will fix the problem. – keithyip Aug 21 '16 at 14:38
  • Kudos for identifying the exact problem @Jaro Though i have added ifndef statements problem is still there. Clearing, Quiting , Rebuilding will help. but still its a bug in xcode. And apple should fix it. – Ashish P May 12 '17 at 05:33
9

I faced the same problem using TTTAttributedLabel and followed Andrey's answer to try to fix it. The build was successful but after that it seems that the bundle files of other pod modules (TSMessage, SVProgressHUD in my case) cannot be loaded. This is also stated in the Cocoapods blog post and I do not want to move the bundle resources to the mainBundle (and I have not verified if this works.)

Therefore I choose to remove TTTAttributedLabel from the Podfile and just include the source directly to get rid of that error. This works for me and I hope it is also another answer to this problem.

ralphchan
  • 411
  • 5
  • 8
  • Only helpful answer for me. – bisma Dec 17 '15 at 10:40
  • 1
    I was using TTTAttributedLabel as well. As a workaround changed the class back to UILabel for TTTAttributedLabels temporarily, made my Auto Layout changes, then set the classes back. Pretty annoying but it worked. – Ben Kane Apr 06 '16 at 21:10
7

May be late, but adding these codes for initialization worked for me when I got this problem

required override init(frame: CGRect) {
    super.init(frame: frame)
}

required init?(coder aDecoder: NSCoder) {
    super.init(coder: aDecoder)
}
Han Daniel
  • 181
  • 2
  • 7
3

I had the same issue as I was using custom view from POD on storyboard.

Doing the following things fixed the issue for me

  • Add the following line (To turn the POD in dynamic framework) on pod use_frameworks!
  • Do pod update
  • Restart the Xcode
Durai Amuthan.H
  • 31,670
  • 10
  • 160
  • 241
3

In Podfile add this script at the end and performed pod install again.

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
Haroldo Gondim
  • 7,725
  • 9
  • 43
  • 62
1

Updating cocoapods in Mac, with following command solved this issue partially for me:

sudo gem install cocoapods
KawaiKx
  • 9,558
  • 19
  • 72
  • 111
1

Problem might be that you have used a framework or Custom UILabel class. like MarqueLabel or TTTAttributed Label. Uncomment #use_frameworks inside pod file. Run pod update. Clean and rebuild your project. This will solve your issue.

Ashish P
  • 1,463
  • 1
  • 20
  • 29
1

I had a similar bug, when I was using Cocoapods and was not able to use_frameworks!. I ended up by forking a framework, that uses IBDesignable and IBInspectable and removing these keywords. All customization is done programmatically:

class CardFloatingLabelTextField: SkyFloatingLabelTextField {

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)

        self.errorMessage = nil
        self.titleFont = UIFont.systemFont(ofSize: 11)
        self.titleFormatter = { (text: String) in return text }
        self.titleColor = UIColor.channelsColorGrayFootnoteAndCaptions()
        self.selectedTitleColor = UIColor.channelsColorGrayFootnoteAndCaptions()
        self.lineColor = UIColor.channelsColorGrayContentAndLines()
        self.selectedLineColor = UIColor.channelsColorDarkBlue()
        self.lineHeight = 1
        self.selectedLineHeight = 1

    }

}

It works and doesn't create bugs in Interface builder anymore. However, it's a pity, that I had to do this workaround.

Denis Kutlubaev
  • 15,320
  • 6
  • 84
  • 70
1

Remove what you've in the Podfile and just include the source directly to fix this issue.

It works for me!

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Sunil Targe
  • 7,251
  • 5
  • 49
  • 80
1

I have faced this problem when both base class and child class are mentioned as @IBDesignable class. May be check with the third party class and your class if it is inherited

Pushpa Raja
  • 642
  • 6
  • 17