IT

Xcode 8-IB 디자인 가능-자동 레이아웃 상태를 렌더링 및 업데이트하지 못했습니다. 에이전트가 충돌했습니다

lottoking 2020. 6. 30. 22:58
반응형

Xcode 8-IB 디자인 가능-자동 레이아웃 상태를 렌더링 및 업데이트하지 못했습니다. 에이전트가 충돌했습니다


최근에 Xcode 8로 업그레이드했으며 스토리 보드에 문제가 있습니다.

프로젝트를 열었고 스토리 보드가 열려 있지 않으면 컴파일되고 제대로 실행될 것입니다. 스토리 보드를 열면 아래와 같이 IB Designables에 대한 여러 오류가 발생합니다.

여기에 이미지 설명을 입력하십시오

이러한 뷰에서 사용자 정의보기를 사용하는 유일한 도면이다 TextFieldEffectsBEMCheckbox내가 Cocoapods를 사용하여 가져올 것이다.


다음 중 하나를 시도하여 원인을 파악할 수 있습니다.

  1. IBDesignablesAgentCocoaTouch이 디렉토리 에서 로그를 찾고 ~/Library/Logs/DiagnosticReports원인을 확인하십시오.

  2. @IBDesignable UIView스토리 보드에서을 선택하는 동안 편집기-> 선택한 뷰 디버그로 이동 하여 스택 추적을 확인하십시오.

  3. 파생 데이터 폴더를 삭제하십시오.

    Xcode Preference -> Location -> Derived Data
    /Users/YourMacName/Library/Developer/Xcode/DerivedData
    
  4. 프로젝트를 청소하십시오 Shift + Command + Alt + K .

  5. 프로젝트 빌드 Command +를 B .


다음을 수행하여 문제를 해결했습니다.

  1. 로 이동하십시오 File > Workspace settings.
  2. "파생 데이터"옆의 작은 오른쪽 화살표를 클릭하십시오. DerivedData폴더 위치에서 Finder 앱이 열립니다 .
  3. DerivedData폴더 내부로 이동 하여 프로젝트에 해당하는 폴더를 삭제하십시오.
  4. Xcode를 종료하고 다시여십시오.
  5. 프로젝트를 청소하십시오 shiftcommandk.
  6. 프로젝트를 빌드하십시오 commandb.
  7. 스토리 보드를 엽니 다.
  8. 로 이동하십시오 Editor > Refresh all views.

업데이트

때로는 그냥 직접 Editor > Refresh all views일했습니다. Refresh all views비활성화 된 경우 Xcode를 종료하고 다시 시도하십시오.


실패한 뷰를 삭제하고 command + Z를 눌러 삭제를 취소합니다. 그것은 나를 위해 작동합니다.

실패한보기를 나중에 편집하면 오류가 다시 발생할 수 있으므로 위의 작업을 다시 수행하십시오.


CocoaPod 1.5.0에서이 문제에 직면했습니다. 해결책은이 오류가 표시되면 포드를 다시 설치 (포드 설치 다시)하는 것입니다. 또는 대신 CocoaPod 1.4.0을 사용할 수 있습니다. 1.4.0 (적어도 나를 위해)에서 잘 작동합니다.

최신 정보:

Podfile에 다음 스크립트를 추가하면 1.5.0의 문제를 해결하는 데 도움이됩니다.

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

참조 : https://github.com/Skyscanner/SkyFloatingLabelTextField/issues/201#issuecomment-381915911


@IBDesignable수업에 다음 코드를 추가 하면 속임수가되었습니다.

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

스토리 보드에서 사용되는 사용자 정의보기에있을 수있는 xib 파일에 대해 '특성 변형 사용'(ID 및 유형 패널)을 비활성화하십시오.


my problem was solved by deleting folders (which is related to this project) from derived data folder. you can do this by clicking File -> Project Setting -> then click the arrow sign deside /Users/.../Xcode/DerivedData click DerivedData folder you will see your project named folders delete those . quit xcode the open your project , clean the project by using this step Product->clean then build the project : Product->Build These will resolve this problems .


For anyone -like me- who can't find that IBDesignablesAgentCocoaTouch file or when trying to 'Debug Selected Views' from the Editor gets an error, here's another way to debug those "Failed to render" errors.

Open the 'Console' app, from the sidebar select your current Mac (it will probably be auto-selected by default) and then on the search bar search for "IBSceneUpdate" and hit enter. Every time you get an Xcode error for an IBDesignable not being able to render, you will also get a new "IBSceneUpdate" entry with more details about the error. Tha't at least how I was able to debug my IBDesignable errors!

여기에 이미지 설명을 입력하십시오


When i debugged this i found out there are some classes which are modifying UI. Typically marquelabel which is a subclass of UILabel or any other class subclassing UIView and drawing ui at run time and colliding with Autolayout engine. Try giving fixed width or height for these custom views. If it doesn't solve your problem try Following solutions:-

Solution 1: - Uncomment #use_frameworks inside your pod file.

Solution 2: - Try deleting derived data

  1. Close Editor window of your Xcode and quit simulator ->
  2. Go to Xcode Preferences -> Locations ->
  3. Click small grey arrow showing derived data path ->
  4. Select your project ->
  5. Delete all the folders inside ->
  6. Quit Xcode and reopen

Just open your storyboard -> Editor -> Refresh all views. This work for me.


If you're using xib file for custom uiview. Try this:

Change from

Bundle.main.loadNibNamed("UserView", owner: self, options: nil)

To:

let bundle = Bundle(for: UserView.self) 
bundle.loadNibNamed("UserView", owner: self, options: nil)

I tried clean and run the project won't solve this issue.

But Close and reopened the project did.


I had the same issue and came here to try and figure out what happened. I noticed the top rated answer and the answer itself didn't help me, as IBDesignable didn't exist in the log folder and I already attempted all other options there, however in the comments I noticed someone talking about a frame init.

I decided to try commenting out my IBDesignable extension for UIView and it instantly fixed the problem. So, to fix this, find the extension causing the issue and make sure to set up the required inits by creating an IBDesignable class and providing the required initializers as follows:

@IBDesignable class RoundedView: UIView {

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

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

override func prepareForInterfaceBuilder() {
    super.prepareForInterfaceBuilder()
    sharedInit()
}

func sharedInit() {
}
}

IMPORTANT: remember to add the new class to the item you are using the designable on.


Faced same Error: Had customised UITextField and using interface builder, the error in console was -Use of unimplemented initializer 'init(frame:)' for class "CustomField"

Added the initialiser to fix the error


I faced this problem after update to latest XCode version .After trying multiple solution described above ,i only quite Xcode and then shut down system and turn it on and that worked for me .


After you make the necessary changes, change the storyboard or in my case a .xib to open in "XCode 7", save and close. This is just a stop gap measure to address the errors but ultimately you will need to fix them or do this until you are no longer able to.


필자의 경우 하위 클래스 인 라이브러리를 사용하고있었습니다 UIView. 이 (가) 사용 IB_DESIGNABLE중이며에 대한 호출이 누락되었습니다 [super awakeFromNib]. 이 메소드에 호출을 추가하면 버그가 사라졌습니다.

구현 중이라는 사실 IB_DESIGNABLE이 이것에 영향을 미쳤 는지 확실하지 않습니다 .

참고 URL : https://stackoverflow.com/questions/39732312/xcode-8-ib-designables-failed-to-render-and-update-auto-layout-status-the-a

반응형