Interface Builder - Failed to load designables from path (null)

IosInterface BuilderXcode6Custom ControlsIbdesignable

Ios 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):

  1. Add 'use_frameworks!' (without the apostrophes, of course) to your podfile
  2. Open up a terminal window
  3. cd to your project's root dir
  4. Run 'pod install' from the command line
  5. Remove the 'use_frameworks!' from your podfile
  6. Run 'pod install' again
  7. 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:

  1. Quit Xcode.
  2. Kill all processes named Interface Builder Cocoa Touch Tool on your machine.
  3. 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:

  1. Product menu > Clean
  2. Hold down Option > Product menu > Clean Build Folder... > Clean
  3. Window menu > Projects > Choose my Framework project > Delete Derived Data
  4. Window menu > Projects > Choose my main project > Delete Derived Data
  5. Quit Xcode
  6. 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

Find more:https://stackoverflow.com/questions/26567650/live-rendering-a-custom-component-using-ib-designable-from-a-pod-dependency

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.

  1. 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
     }
    

    }

  2. Add a liveDebugLog(message:) and put whatever you want to know.

  3. Open Terminal.app and run the command open /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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJakeView Question on Stackoverflow
Solution 1 - Iosi89View Answer on Stackoverflow
Solution 2 - IosAnthony TaylorView Answer on Stackoverflow
Solution 3 - IosJohn JaceckoView Answer on Stackoverflow
Solution 4 - IosJBarros35View Answer on Stackoverflow
Solution 5 - IosDennisView Answer on Stackoverflow
Solution 6 - IospjuzeliunasView Answer on Stackoverflow
Solution 7 - IosWilliam KeyView Answer on Stackoverflow
Solution 8 - IosPeiweiChenView Answer on Stackoverflow
Solution 9 - IosAntziView Answer on Stackoverflow
Solution 10 - IosRafael MachadoView Answer on Stackoverflow
Solution 11 - IosYuvraj KaleView Answer on Stackoverflow
Solution 12 - IosKawaiKxView Answer on Stackoverflow
Solution 13 - IosSPSView Answer on Stackoverflow
Solution 14 - IosmariosmView Answer on Stackoverflow
Solution 15 - IoshighrankinView Answer on Stackoverflow
Solution 16 - IosPSchuetteView Answer on Stackoverflow