Xcode 6:构建挂起,Interface Builder Cocoa Touch Tool 开始分配所有 RAM

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26169559/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:46:27  来源:igfitidea点击:

Xcode 6: Build hangs and Interface Builder Cocoa Touch Tool starts allocating all RAM

iosxcodeinterface-builderxcode6

提问by HotFudgeSunday

I'm having an issue to which I haven't been able to find a solution just by searching here or on Google.

我遇到了一个问题,我无法仅通过在此处或在 Google 上搜索来找到解决方案。

I'm building a project which is shared by multiple developers. For some reason I'm the only one with this issue. I checked out the code several times and even re-installed Xcode.

我正在构建一个由多个开发人员共享的项目。出于某种原因,我是唯一一个遇到这个问题的人。我检查了几次代码,甚至重新安装了 Xcode。

So what happens is that when I build the project the build process hangs forever. A process called “Interface Builder Cocoa Touch Tool” runs and starts accumulating RAM until it reached the Mac's limit (which is 16 GB). At this point, as soon as I see that I kill the process and the build fails.

所以发生的情况是,当我构建项目时,构建过程永远挂起。一个名为“Interface Builder Cocoa Touch Tool”的进程运行并开始累积 RAM,直到达到 Mac 的限制(16 GB)。在这一点上,一旦我看到我终止了进程并且构建失败。

On the Console App I see this:

在控制台应用程序上,我看到了这个:

2014-10-02 4:45:16.013 PM Interface Builder Cocoa Touch Tool[875]: BUG in libdispatch client: kevent[EVFILT_VNODE] add: "Bad file descriptor" - 0x9
2014-10-02 4:45:17.956 PM Interface Builder Cocoa Touch Tool[875]: assertion failed: 13F34: libxpc.dylib + 29453 [75E30F22-514B-3A20-B82C-EDA43AF5C35C]: 0x8d

On Xcode I see the build getting stuck on “Compiling 1 of 1 story board files”, or “Compiling 1 of 1 asset catalogs”.

在 Xcode 上,我看到构建卡在“编译 1 of 1 故事板文件”或“编译 1 of 1 资产目录”上。

Even if I stop the build, the “Interface Builder Cocoa Touch Tool” process will continue running and accumulating RAM.

即使我停止构建,“Interface Builder Cocoa Touch Tool”进程也会继续运行并积累 RAM。

I do see two warnings related to the story board:

我确实看到了与故事板相关的两个警告:

Base.lproj/MainStoryboard.storyboard Frame for "Scroll View" will be different at run time.
Base.lproj/MainStoryboard.storyboard: warning: Unsupported Configuration: Prototype table cells must have reuse identifiers

And I see two warnings for the assets:

我看到资产的两个警告:

../Images-2.xcassets: A 57x57 app icon is required for iPhone apps targeting releases of iOS prior to 7.0
../Images-2.xcassets: A 57x57@2x app icon is required for iPhone apps targeting releases of iOS prior to 7.0

But I don't think these are the cause.

但我不认为这些是原因。

Here are Xcode's and the Mac's information:

以下是 Xcode 和 Mac 的信息:

2.5 Ghz, Core i7 with 16 GB of Ram. Os X 10.9.5. Xcode 6.0.1.

2.5 Ghz,酷睿 i7 和 16 GB 内存。操作系统 X 10.9.5。Xcode 6.0.1。

Any help is more than welcomed.

任何帮助都非常受欢迎。

Thanks.

谢谢。

回答by knukko

I had the exact same problem: opening the storyboard in xcode results in beach ball with the Interface Builder task consuming all the memory. I got it back working by editing the xml of the storyboard file and setting

我遇到了完全相同的问题:在 xcode 中打开故事板会导致沙滩球,Interface Builder 任务消耗了所有内存。我通过编辑情节提要文件的 xml 和设置使其恢复工作

useAutolayout="NO"

in the document node. Of cause this is not a solution to the problem (which seems to be a bug in xcode) because it screws all constraints, but at least I could open and compile the storyboard again.

在文档节点中。当然,这不是问题的解决方案(这似乎是 xcode 中的一个错误),因为它解决了所有约束,但至少我可以再次打开并编译故事板。

回答by Felipe Baytelman

Apparently, there's a corrupted .xib file. I reverted the file that was getting stuck compiling. I'm researching what's the line that's making it crash.

显然,有一个损坏的 .xib 文件。我恢复了编译时卡住的文件。我正在研究导致它崩溃的线路是什么。

EDIT

编辑

I reproduced the problem in the console: There is a serious bug ongoing here.

我在控制台中重现了这个问题:这里有一个严重的错误。

Felipes-MacBook-Pro:FitMob-ios fbaytelm$     /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool --target-device iphone --errors --warnings --notices --module fitmobAppStore --minimum-deployment-target 7.0 --output-partial-info-plist /Users/fbaytelm/Library/Developer/Xcode/DerivedData/fitmob-fpoxwngwxzwfqrebczuslduvfozr/Build/Intermediates/fitmob.build/Debug-iphonesimulator/fitmobAppStore.build/FMSplashViewController-PartialInfo.plist --auto-activate-custom-fonts --output-format human-readable-text --compile /Users/fbaytelm/Library/Developer/Xcode/DerivedData/fitmob-fpoxwngwxzwfqrebczuslduvfozr/Build/Products/Debug-iphonesimulator/fitmobAppStore.app/FMSplashViewController.nib /Users/fbaytelm/Documents/workspace/FitMob-ios/FitMob/Classes/Views/Common/FMSplashViewController.xib
2014-10-10 01:38:48.386 ibtoold[23113:213948] [MT] DVTAssertions: ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilder/IDEInterfaceBuilder-6249/InterfaceBuilderKit/Utilities/IBAbstractMessageChannelInterfaceBuilderToolProxy.m:40
Details:  Failed to determine the value for availableFonts of UIFont.

Encountered an error communicating with Interface Builder Cocoa Touch Tool. If you choose to file a crash report or Radar for this issue, please check Console.app for crash reports for "Interface Builder Cocoa Touch Tool" and include their content in your crash report.

Exception name: IBRemoteToolFailureException
Exception reason: Interface Builder Cocoa Touch Tool crashed

Last command:
valueForKeyPath:ofClassWithName:resultMarshaller:resultMarshallerContext:

Backtrace of last command:
  0  0x000000010d5dc3e1 (in IDEInterfaceBuilderCocoaTouchIntegration)
  1  0x000000010d5a4cd1 IBAskClassInTargetRuntimeForValueForKeyPathUsingResultMarshallerWithContext (in IDEInterfaceBuilderCocoaTouchIntegration)
  2  0x000000010d5a4b38 IBAskClassInTargetRuntimeForValueForKeyPathUsingResultMarshaller (in IDEInterfaceBuilderCocoaTouchIntegration)
  3  0x000000010d5d7bae (in IDEInterfaceBuilderCocoaTouchIntegration)
  4  0x000000010d5d7a35 (in IDEInterfaceBuilderCocoaTouchIntegration)
  5  0x000000010d5d8873 (in IDEInterfaceBuilderCocoaTouchIntegration)
  6  0x000000010d64cb26 (in IDEInterfaceBuilderCocoaTouchIntegration)
  7  0x000000010d67b46b IBUIValidateFontDescription (in IDEInterfaceBuilderCocoaTouchIntegration)
  8  0x000000010d6e9fe7 (in IDEInterfaceBuilderCocoaTouchIntegration)
  9  0x000000010762177f -[IBDocumentIssueGenerator updateIssuesForMembers:] (in IDEInterfaceBuilderKit)
 10  0x0000000107622790 -[IBDocumentIssueGenerator validateIssues:] (in IDEInterfaceBuilderKit)
 11  0x000000010667f37e -[DVTDelayedInvocation runBlock:] (in DVTFoundation)
 12  0x000000010667f903 -[DVTDelayedInvocation invokeIfNeeded] (in DVTFoundation)
 13  0x000000010762289b -[IBDocumentIssueGenerator warnings] (in IDEInterfaceBuilderKit)
 14  0x00000001065aebbb (in ibtoold)
 15  0x00000001065a130f (in ibtoold)
 16  0x00000001065a4b21 (in ibtoold)
 17  0x00000001065aa3f7 (in ibtoold)
 18  0x00000001065aa947 (in ibtoold)
 19  0x00000001065aa817 (in ibtoold)
 20  0x0000000106599d4f (in ibtoold)
 21  0x00000001065a9fe1 (in ibtoold)
 22  0x00000001065a9238 (in ibtoold)
 23  0x00007fff90ff15c9 start (in libdyld.dylib)

Exception backtrace:
(null)
Exception info:{
    IBUnderlyingError = "Error Domain=IBMessageChannelErrorDomain Code=4 \"Failed to communicate with Interface Builder\" UserInfo=0x7fe7fbf43020 {NSLocalizedDescription=Failed to communicate with Interface Builder, NSLocalizedFailureReason=Interface Builder Cocoa Touch Tool crashed}";
}

Function: void IBAssertMarshallingFailure(NSString *__strong, NSString *__strong, NSString *__strong)
Thread:   <NSThread: 0x7fe7f941adf0>{number = 1, name = main}
Hints: None
Backtrace:
  0  0x00000001067982e4 -[DVTAssertionHandler handleFailureInFunction:fileName:lineNumber:assertionSignature:messageFormat:arguments:] (in DVTFoundation)
  1  0x0000000106797a7b _DVTAssertionHandler (in DVTFoundation)
  2  0x0000000106797cde _DVTAssertionFailureHandler (in DVTFoundation)
  3  0x0000000107676973 IBAssertMarshallingFailure (in IDEInterfaceBuilderKit)
  4  0x000000010d5a4e1c IBAskClassInTargetRuntimeForValueForKeyPathUsingResultMarshallerWithContext (in IDEInterfaceBuilderCocoaTouchIntegration)
  5  0x000000010d5a4b38 IBAskClassInTargetRuntimeForValueForKeyPathUsingResultMarshaller (in IDEInterfaceBuilderCocoaTouchIntegration)
  6  0x000000010d5d7bae (in IDEInterfaceBuilderCocoaTouchIntegration)
  7  0x000000010d5d7a35 (in IDEInterfaceBuilderCocoaTouchIntegration)
  8  0x000000010d5d8873 (in IDEInterfaceBuilderCocoaTouchIntegration)
  9  0x000000010d64cb26 (in IDEInterfaceBuilderCocoaTouchIntegration)
 10  0x000000010d67b46b IBUIValidateFontDescription (in IDEInterfaceBuilderCocoaTouchIntegration)
 11  0x000000010d6e9fe7 (in IDEInterfaceBuilderCocoaTouchIntegration)
 12  0x000000010762177f -[IBDocumentIssueGenerator updateIssuesForMembers:] (in IDEInterfaceBuilderKit)
 13  0x0000000107622790 -[IBDocumentIssueGenerator validateIssues:] (in IDEInterfaceBuilderKit)
 14  0x000000010667f37e -[DVTDelayedInvocation runBlock:] (in DVTFoundation)
 15  0x000000010667f903 -[DVTDelayedInvocation invokeIfNeeded] (in DVTFoundation)
 16  0x000000010762289b -[IBDocumentIssueGenerator warnings] (in IDEInterfaceBuilderKit)
 17  0x00000001065aebbb (in ibtoold)
 18  0x00000001065a130f (in ibtoold)
 19  0x00000001065a4b21 (in ibtoold)
 20  0x00000001065aa3f7 (in ibtoold)
 21  0x00000001065aa947 (in ibtoold)
 22  0x00000001065aa817 (in ibtoold)
 23  0x0000000106599d4f (in ibtoold)
 24  0x00000001065a9fe1 (in ibtoold)
 25  0x00000001065a9238 (in ibtoold)
 26  0x00007fff90ff15c9 start (in libdyld.dylib)

回答by MobileVet

I had two Xcode versions installed, 5 & 6. Not sure if this was the cause, but Apple indicated this does happen with people and that the appropriate action is to ensure that the correct version is 'selected'

我安装了两个 Xcode 版本,5 和 6。不确定这是否是原因,但 Apple 表示这确实发生在人们身上,适当的操作是确保“选择”了正确的版本

xcode-select -p

Not sure this would have fixed the issue or not, but after removing both versions and then installing Xcode 6, things appear to have been resolved.

不确定这是否能解决问题,但在删除两个版本然后安装 Xcode 6 后,事情似乎已经解决。

回答by Bin Zhou

In Xcode, right-click on the storyboard file and select Open As -> Source Code. In the source code editor, change the value of "useAutolayout" to "NO". Then, you should be able to open your storyboard as Interface Builder. I ran into this annoying issue. Now, all of my storyboard files created in Xcode 5 can be open in Xcode 6 now.

在 Xcode 中,右键单击 storyboard 文件并选择 Open As -> Source Code。在源代码编辑器中,将“useAutolayout”的值更改为“NO”。然后,您应该能够以 Interface Builder 的形式打开故事板。我遇到了这个烦人的问题。现在,我在 Xcode 5 中创建的所有故事板文件现在都可以在 Xcode 6 中打开了。

回答by user2002649

I fixed the problem by changing the Builds Forsetting in the File Inspector for the storyboard from iOS6 & Later to iOS8 & Later It seems to work on iOS 7.0 & later, but changing it back to any of the iOS6 settings makes the problem recur.

我通过将故事板的文件检查器中的Builds For设置从 iOS6 及更高版本更改为 iOS8 及更高版本来解决此问题。它似乎适用于 iOS 7.0 及更高版本,但将其更改回任何 iOS6 设置会使问题再次出现。

回答by AndyDeveloper

I too have been having issues with storyboards causing freezes with XCode 6.0.1 on OS X 10.9.5.
I can't even start Xcode because it tries to re-open the storyboard.

我也遇到了故事板问题,导致 OS X 10.9.5 上的 XCode 6.0.1 冻结。
我什至无法启动 Xcode,因为它试图重新打开故事板。

Here's what I do to recover (until it happens again)

这是我为恢复所做的工作(直到它再次发生)

IMPORTANT: make sure you back up your storyboard file in case you accidentally delete it

重要提示:请确保备份您的故事板文件,以防您不小心将其删除

  1. Completely close Xcode
  2. From a Terminal (or Finder): MOVEyour storyboard file to a safe location
  3. Restart XCode and open your workspace or project
  4. In Xcode: remove the missing storyboard file from the project
  5. From a Terminal (or Finder): COPYyour storyboard back to its original location
  6. Import the storyboard to Xcode (Add File or drag-drop from Finder)
  1. 完全关闭Xcode
  2. 从终端(或 Finder):将故事板文件移动到安全位置
  3. 重新启动 XCode 并打开您的工作区或项目
  4. 在 Xcode 中:从项目中删除丢失的故事板文件
  5. 从终端(或 Finder):将故事板复制回其原始位置
  6. 将故事板导入 Xcode(添加文件或从 Finder 拖放)

At this point everything "usually" works for me: open the storyboard, build, run... I can keep working with the storyboard until the next time I re-open the project. Then it happens again and I have to repeat the same steps.

在这一点上,一切“通常”都对我有用:打开故事板,构建,运行......我可以继续使用故事板,直到下次我重新打开项目。然后它再次发生,我必须重复相同的步骤。

回答by jwrnr

I too had this issue and think I have found the reason for the hanging; I removed some constraints from the storyboard and I no longer get this freeze during the build phase.

我也有这个问题,我想我已经找到了挂起的原因;我从情节提要中删除了一些限制,并且在构建阶段不再冻结。

回答by Felipe Baytelman

I did a "binary search" to find which element was corrupting my .xib file.

我进行了“二进制搜索”以查找哪个元素损坏了我的 .xib 文件。

Each time, I had to kill Xcode, delete Derived Data. Once I found the sub-view that was causing the problem, I removed and reconstructed it.

每次,我都必须杀死 Xcode,删除派生数据。找到导致问题的子视图后,我将其删除并重建。

回答by Simon Tseng

I fixed this issue by just resolved all warnings related to storyboard. For example: 1. I deleted unused prototype cell in TableView, because it will cause warning about something like "No reuse Identifier". 2. I deleted unused view controller.

我通过解决与故事板相关的所有警告来解决此问题。例如: 1.我在TableView中删除了未使用的原型单元格,因为它会导致类似“不能重用标识符”的警告。2. 我删除了未使用的视图控制器。

回答by 4mo1

I am not using Storyboards but I think the problem here may be at a higher level and not related to storyboards. I faced the same problem (xcode hangs while trying to build the app, activity monitor shows interface builder using 99% CPU).

我没有使用故事板,但我认为这里的问题可能在更高的层次上,与故事板无关。我遇到了同样的问题(尝试构建应用程序时 xcode 挂起,活动监视器显示使用 99% CPU 的界面构建器)。

The following worked for me - In the .xcodeproj file, changing the iOS Deployment Target from 6.0 to 7.0 fixed it instantly.

以下对我有用 - 在 .xcodeproj 文件中,将 iOS 部署目标从 6.0 更改为 7.0 立即修复了它。