xcode ibtool 编译故事板时失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14006093/
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 02:23:21  来源:igfitidea点击:

ibtool failed when compiling storyboard

xcodemacosstoryboardxcode4.5

提问by javsmo

I just downloaded a project from a git repository on two different Macbooks. On the first, it runs without problem.

我刚刚从两台不同 Macbook 上的 git 存储库下载了一个项目。首先,它运行没有问题。

On the second Macbook shows me the following message:

在第二台 Macbook 上向我显示以下消息:

Command /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool 
failed with exit code 255

When trying to compile the file MainStoryboard.storyboard.

尝试编译文件时MainStoryboard.storyboard

When I click the MainStoryboard.storyboard on XCode, it crashes and doesn't open it.

当我在 XCode 上单击 MainStoryboard.storyboard 时,它会崩溃并且无法打开它。

On the other computer, everything works fine.

在另一台计算机上,一切正常。

I tried the following things to fix this problem, without success:

我尝试了以下方法来解决这个问题,但没有成功:

1) Upgraded XCode from 4.5 to 4.5.2

1) 将 XCode 从 4.5 升级到 4.5.2

2) Removed the project directory and cloned the repository again.

2)删除项目目录并再次克隆存储库。

3) Deleted the contents of my project on ~/Library/Developer/Xcode/DerivedData

3)删除了我的项目内容 ~/Library/Developer/Xcode/DerivedData

4) purge

4) purge

Any ideas on how to fix this problem?

关于如何解决这个问题的任何想法?

采纳答案by javsmo

Almost half year later I finally succeeded to discover what was causing this problem and fixed the bug.

将近半年后,我终于成功地发现了导致此问题的原因并修复了该错误。

Now, with XCode 4.6.3 it gives me another clue about the problem:

现在,有了 XCode 4.6.3,它给了我关于这个问题的另一个线索:

2013-06-28 18:15:32.606 Interface Builder Cocoa Touch Tool[7894:f07] CFPreferences: user home directory at file://localhost/Users/[myusername]/Library/Application%20Support/iPhone%20Simulator/User/ is unavailable. User domains will be volatile.Command /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool failed with exit code 255

After receiving this new message, I searched for this Userfolder inside "iPhone Simulator" and there were no folder named "User".

收到这条新消息后,我在“iPhone Simulator”中搜索了这个用户文件夹,但没有名为“用户”的文件夹。

I created the "User" folder, did a clean and after this I was able to build the project again!

我创建了“用户”文件夹,进行了清理,之后我能够再次构建项目!

回答by javsmo

Found this issue using XCode 5.

使用 XCode 5 发现此问题。

I've solved the issue, but it required a hard reset.

我已经解决了这个问题,但它需要硬重置。

Some said it was because I installed XCode outside of the App Store, or because the simluator was buggy, or because XCode was pointing at the wrong version of the Simulator, or a resoruce was missing a target membership, or whatever. I tried all of that.

有人说这是因为我在 App Store 之外安装了 XCode,或者因为模拟器有问题,或者因为 XCode 指向了错误的模拟器版本,或者资源缺少目标成员资格,或者其他什么。我尝试了所有这些。

I downloaded XCode from the App Store, re-installed the Simulators, and still no luck. So I just rolled back my repository to an earlier date, and lost some work in the process. Not much though, because I always commit little and often.

我从 App Store 下载了 XCode,重新安装了模拟器,但仍然没有运气。所以我只是将我的存储库回滚到更早的日期,并在此过程中丢失了一些工作。不过不多,因为我总是很少而且经常提交。

Since ever starting to use storyboards back in 2011, I have always committed little AND OFTEN. Storyboards are fragile.

自从 2011 年开始使用故事板以来,我一直很少而且经常做出承诺。故事板是脆弱的。

EDIT After adding the new components back in, the problem re-surfaced.

编辑重新添加新组件后,问题再次浮出水面。

I noticed that I put a static table view, within a UIViewController. I was doing this before.

我注意到我在 UIViewController 中放置了一个静态表视图。我以前就是这样做的。

I was using a subclass of UITableViewController in code, but the storyboard scene, was a UIViewController. I dragged out a UITableViewController instead, and moved the table view cells into that, and it solved the issue.

我在代码中使用了 UITableViewController 的子类,但故事板场景是一个 UIViewController。我拖出一个 UITableViewController ,并将表格视图单元格移到其中,它解决了这个问题。

All thanks to missing error messages. Where have they all gone since XCode 5?

这一切都归功于缺少错误消息。自 XCode 5 以来,它们都去哪儿了?

回答by GraehamF

the fix for me in Xcode 6.4 was to ... restart my computer. sad, but true.

在 Xcode 6.4 中对我的修复是...重新启动我的计算机。悲伤,但真实。

回答by Cocoanetics

Do a

做一个

which ibtool

which ibtool

At the command line on both Macs. Chances are they are different.

在两台 Mac 上的命令行中。机会是他们是不同的。

Before Xcode was bundled in a single .app bundle it would install command line tools in folders like /usr/local.

在 Xcode 捆绑在单个 .app 包中之前,它会在 /usr/local 等文件夹中安装命令行工具。

I would recommend you remove those local copies to avoid interference with Xcode's built in version, i.e. that it uses the old version. If you still want to be able to use ibtool from the command line, here's an explanation about xcrun: http://www.cocoanetics.com/2012/07/you-dont-need-the-xcode-command-line-tools/

我建议您删除这些本地副本以避免干扰 Xcode 的内置版本,即它使用旧版本。如果您仍然希望能够从命令行使用 ibtool,这里有一个关于 xcrun 的解释:http: //www.cocoanetics.com/2012/07/you-dont-need-the-xcode-command-line-tools /

回答by Joaquin Pereira

I don't know if someone is still struggling with this error but today was my turn to confront it. I just solved it. This is the context:

我不知道是否有人还在为这个错误而苦苦挣扎,但今天轮到我去面对它了。我刚刚解决了。这是上下文:

I had a UITableViewCell with half of it cover by a simple UIVIEW. Inside this UIVIEW i had many other view (UILables, UITextField, etc etc)

我有一个 UITableViewCell,其中一半被一个简单的 UIVIEW 覆盖。在这个 UIVIEW 中,我有许多其他视图(UILables、UITextField 等)

Just where the UIVIEW ended (Again it covered the middle of the entire UITableViewCell) i placed an UIImageView. Half of the UIImageView covered the UIView and the other half was on the UITableView itself. In the Hierarchy the UIImageView was on the UITableVIewCell and not inside the UIView.

就在 UIVIEW 结束的地方(再次覆盖整个 UITableViewCell 的中间),我放置了一个 UIImageView。UIImageView 的一半覆盖了 UIView,另一半在 UITableView 本身上。在层次结构中,UIImageView 位于 UITableVIewCell 上,而不是在 UIView 内。

The problem was when i was applying autolayout i put a constraint between a view inside the UIView and the UIImageView that was outside of the UIVIEW.

问题是当我应用自动布局时,我在 UIView 内部的视图和 UIVIEW 外部的 UIImageView 之间放置了一个约束。

When i run the app, the error came up. After half an hour deleting views and stuff i realized that the error was caused by that constraint. After deleting that constraint, the error was gone.

当我运行该应用程序时,出现了错误。半小时后删除视图和内容,我意识到错误是由该约束引起的。删除该约束后,错误消失了。

So bottom line, check your constraints! only "Connect" views with others that are inside the same superView.

所以最重要的是,检查你的约束!仅与同一超级视图内的其他视图“连接”。

Good luck!

祝你好运!

回答by Matt Bearson

I was getting the same error. It turned out I had miswired some of the outlets in the tableview cell.

我遇到了同样的错误。事实证明,我在 tableview 单元中错误地连接了一些插座。

回答by Scott Berrevoets

Try completely reinstalling Xcode. Seems like there's something wrong with ibtool that a reinstall is probably able to fix.

尝试完全重新安装 Xcode。似乎 ibtool 有问题,重新安装可能可以修复。