Interface Builder - Failed to load designables from path (null)
IosInterface BuilderXcode6Custom ControlsIbdesignableIos Problem Overview
I have some custom controls I have created and I'm them using in a new project. However, I keep getting errors in interface builder:
Failed to update auto layout status: Failed to load designables from path (null)
or
Failed to render instance of <control>: Failed to load designables from path (null)
I've tested out the controls in another project and they seem to render correctly in interface builder, but I cannot get them to work in the current project. What causes this error and how might I fix it?
Thanks in advance...
Ios Solutions
Solution 1 - Ios
I had the same issue. I use cocoapods and there is a pod which uses designables. So the trick was to add 'use_frameworks!' to the Podfile. do a 'pod update' reopen the xcode project and the error message shouldn't show up.
Solution 2 - Ios
Edit**
Open Xcode (but do not open your project) and click on Window (second from the right)
Click Organizer and make sure you're on Projects, then delete all derived data. Close out Xcode and then reopen your project and let Xcode re-index your files and see if that clears up the issue
Solution 3 - Ios
I'm running Xcode 7.3, and got the error to magically disappear by following these steps that, in the end, left my project in the exact state that it was prior to following these steps (i.e. a net zero change to anything):
- Add 'use_frameworks!' (without the apostrophes, of course) to your podfile
- Open up a terminal window
- cd to your project's root dir
- Run 'pod install' from the command line
- Remove the 'use_frameworks!' from your podfile
- Run 'pod install' again
- Try building again and see if that fixes the error; it did for me
Looks like one of those occasional Xcode snags that we've all seen before, especially when you're in a hurry to get something else done.
Solution 4 - Ios
If previous solutions didn't works for you, try adding to your target pod inherit! :search_paths
Sample
target 'my-app-target' do
use_frameworks!
inherit! :search_paths
end
After that do a pod update as suggested before.
Solution 5 - Ios
I am not sure if this solves your problem, as I cannot reproduce it. But I thought you might give it a try anyway.
First, as others mentioned, it seems that CocoaPods had the same problem. I went through the commits that made up their corrections, but with no result related to your setting.
However, I found a different related error message in this StackOverflow question, which was also related to something not being found by IB on the path. I wondered if their solution could help you:
The solution was to add $(CONFIGURATION_BUILD_DIR)
in the target's Build settings
Runpath Search Paths
field.
Solution 6 - Ios
I had the same issue on non-CocoaPods project with custom IBDesignable
views. Apparently, it's an Xcode bug. Steps in this answer helped me to resolve the problem. In short:
- Quit Xcode.
- Kill all processes named
Interface Builder Cocoa Touch Tool
on your machine. - Start Xcode again.
Solution 7 - Ios
I don't use CocoaPods, but I do use a in-house framework that contains IBDesignable items, and was also experiencing this problem. I cleaned, deleted the Derived Data from my main project, and restarted Xcode, but that didn't seem to fix it. To resolve it, I had to go to Window > Projects, select the framework project (not the project that used the framework, but rather the framework project itself), and delete the Derived Data. So, full steps:
- Product menu > Clean
- Hold down Option > Product menu > Clean Build Folder... > Clean
- Window menu > Projects > Choose my Framework project > Delete Derived Data
- Window menu > Projects > Choose my main project > Delete Derived Data
- Quit Xcode
- Restart Xcode
Repeat step 3 for any and all framework projects that have IBDesignables and may be causing the errors.
Solution 8 - Ios
This issue fixed in the latest version of Cocoapods
To install,simply run:
[sudo] gem install cocoapods --pre
In order to fix the Error: "failed to load designables from path (null)":
use_frameworks!
pod '****'
end
Add use_frameworks!
to you Podfile
Solution 9 - Ios
The issues was that IB_DESIGNABLE from cocoapods are not linked correctly when interface builder render your views.
The use_frameworks!
trick should do it but for me it was just a bit too much effort to migrate the code.
My trick was to subclass every IB_DESIGNABLE view I used in the storyboard that came straight from the pods. Solved the errors.
Solution 10 - Ios
There's a very handy trick you can do to debug live rendering.
-
Add this extension to your project:
extension UIView { public func liveDebugLog(message: String) { #if !(TARGET_OS_IPHONE) let logPath = "/tmp/XcodeLiveRendering.log" if !NSFileManager.defaultManager().fileExistsAtPath(logPath) { NSFileManager.defaultManager().createFileAtPath(logPath, contents: NSData(), attributes: nil) } var fileHandle = NSFileHandle(forWritingAtPath: logPath) fileHandle.seekToEndOfFile() let date = NSDate() let bundle = NSBundle(forClass: self.dynamicType) let application: AnyObject = bundle.objectForInfoDictionaryKey("CFBundleName") let data = "\(date) \(application) \(message)\n".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: true) fileHandle.writeData(data) #endif }
}
-
Add a
liveDebugLog(message:)
and put whatever you want to know. -
Open
Terminal.app
and run the commandopen /tmp/XcodeLiveRendering.log
Done!
Credits for Morten Bøgh
Solution 11 - Ios
i have solved that issue by updating the pod "pod update" hope it will work for you
Solution 12 - Ios
This error appeared when I updated the pods while the xcode and my project was open.
> I shut the xcode down. ran the pod update again. restarted xcode.
error didn't appear again.
Solution 13 - Ios
If you're already fed up trying to figure out the solution or in case it is Friday afternoon just relax and delete the derived data folder, clean build Xcode, shut down your mac, take a 5 min break(if you're not fire-fighting through your deadline :P ). Turn on your mac launch Xcode try building again.
If this works just curse Xcode and move on like I did :)
Solution 14 - Ios
I wasn't using cocoa pods but getting this error on a view controller extending an imported classes. I was only getting this error when changing the StoryBoard to IphoneX view, it was working fine on iPhone 8 view.
I changed the project settings from New Build System (Preview) to Standard Build system, then clean the project and the error disappeared.
No idea why but that solved the problem for me.
Solution 15 - Ios
All Pods
related fixes did not work for me but deleting the Derived Data
folders worked. Xcode 11
Solution 16 - Ios
Clean + restart XCode did if for me. If the issue stems from you creating an IBDesignable view then deleting an inspectable or the designable tag, I would absolutely try this approach