IB Designables: Failed to render and update auto layout status for

https://www.raywenderlich.com/156971/cocoapods-tutorial-swift-getting-started

https://github.com/CocoaPods/CocoaPods/issues/5334

keronsen

keronsen commented 2018年3月21日 GMT+8 下午5:24

I'm writing a pod containing ibdesignables as well as pod dependencies and I'm running into the interface builder issue in this discussion when using the pod in apps. I would like to contribute towards fixing the problem, but don't really understand enough about the XCode build process (yet). Probably don't understand enough about how CocoaPods work either.

But I found that when I add this to my podspec the problem goes away:

s.pod_target_xcconfig = { 'LD_RUNPATH_SEARCH_PATHS' => '$(FRAMEWORK_SEARCH_PATHS)' }

The comments from @adc-amatosov here #5334 (comment) makes me wonder if this has some side-effects for production apps that I'm not aware of. I would be really happy if anyone could point me in the right direction to understanding this better.

https://github.com/CocoaPods/CocoaPods/issues/5334#issuecomment-255831772

arifken

**arifken **commented 2016年10月25日 GMT+8 上午2:54

We recently ran into a similar issue with IBDesignables "image not found" issues, and were able to work around the problem by adding FRAMEWORK_SEARCH_PATHS to the runpath search paths.

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings['LD_RUNPATH_SEARCH_PATHS'] = [
      '$(FRAMEWORK_SEARCH_PATHS)'
    ]
  end
end

view Debugging

当为view增加 IB_DESIGNABLE时,可能经常出现 error: IB Designables: Failed to render and update auto layout status for UIView (i5M-Pr-FkT): The agent crashed的情况

此时有两种调试方法:

  1. 在xib或者sb中,选择自定义视图,然后选择 Editor- Debug Selected Views。这会重新对这view运行 IBDesignableAgentCocoaTouch,可以进入视图的断点进行调试

  2. ~/Library/Logs/DiagnosticReports目录中有命名为 IBDesignablesAgentCocoaTouch_*.crash的崩溃日志,记录了堆栈信息,code ~/Library/Logs/DiagnosticReports/IBDesignablesAgentCocoaTouch_*.crash

你可能感兴趣的:(IB Designables: Failed to render and update auto layout status for)