Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 871
Jake Avatar asked Feb 08 '15 06:02

Jake


5 Answers

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.

like image 83
i89 Avatar answered Oct 20 '22 16:10

i89


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

like image 40
Anthony Taylor Avatar answered Oct 20 '22 16:10

Anthony Taylor


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.

like image 7
John Jacecko Avatar answered Oct 20 '22 16:10

John Jacecko


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.

like image 5
JBarros35 Avatar answered Oct 20 '22 15:10

JBarros35


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.

like image 3
Dennis Avatar answered Oct 20 '22 16:10

Dennis