Xcode 8-IB 디자인 가능-자동 레이아웃 상태를 렌더링 및 업데이트하지 못했습니다. 에이전트가 충돌했습니다
최근에 Xcode 8로 업그레이드했으며 스토리 보드에 문제가 있습니다.
프로젝트를 열었고 스토리 보드가 열려 있지 않으면 컴파일되고 제대로 실행될 것입니다. 스토리 보드를 열면 아래와 같이 IB Designables에 대한 여러 오류가 발생합니다.
이러한 뷰에서 사용자 정의보기를 사용하는 유일한 도면이다 TextFieldEffects
와 BEMCheckbox
내가 Cocoapods를 사용하여 가져올 것이다.
다음 중 하나를 시도하여 원인을 파악할 수 있습니다.
IBDesignablesAgentCocoaTouch
이 디렉토리 에서 로그를 찾고~/Library/Logs/DiagnosticReports
원인을 확인하십시오.@IBDesignable UIView
스토리 보드에서을 선택하는 동안 편집기-> 선택한 뷰 디버그로 이동 하여 스택 추적을 확인하십시오.파생 데이터 폴더를 삭제하십시오.
Xcode Preference -> Location -> Derived Data /Users/YourMacName/Library/Developer/Xcode/DerivedData
프로젝트를 청소하십시오
Shift
+Command
+Alt
+K
.프로젝트 빌드
Command
+를B
.
다음을 수행하여 문제를 해결했습니다.
- 로 이동하십시오
File > Workspace settings
. - "파생 데이터"옆의 작은 오른쪽 화살표를 클릭하십시오.
DerivedData
폴더 위치에서 Finder 앱이 열립니다 . DerivedData
폴더 내부로 이동 하여 프로젝트에 해당하는 폴더를 삭제하십시오.- Xcode를 종료하고 다시여십시오.
- 프로젝트를 청소하십시오 shiftcommandk.
- 프로젝트를 빌드하십시오 commandb.
- 스토리 보드를 엽니 다.
- 로 이동하십시오
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
- Close Editor window of your Xcode and quit simulator ->
- Go to Xcode Preferences -> Locations ->
- Click small grey arrow showing derived data path ->
- Select your project ->
- Delete all the folders inside ->
- 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
이 이것에 영향을 미쳤 는지 확실하지 않습니다 .
'IT' 카테고리의 다른 글
Python 실행 파일이 libpython 공유 라이브러리를 찾을 수 없음 (0) | 2020.07.01 |
---|---|
C #에서 문자열 키 유형의 대소 문자 구분 사전 (0) | 2020.07.01 |
아무것도 선택하지 않도록 jQuery에서 라디오 버튼을 재설정하는 방법 (0) | 2020.06.30 |
Java에서 파생 클래스의 재정의 메서드에서 기본 클래스의 메서드를 어떻게 호출합니까? (0) | 2020.06.30 |
“”와“”의 차이점은 무엇입니까? (0) | 2020.06.30 |