【问题标题】:Command CompileXIB failed with a nonzero exit code命令 CompileXIB 失败,退出代码为非零
【发布时间】:2019-12-03 11:57:13
【问题描述】:

我在使用 Xcode 构建 ios 应用程序时遇到问题。之前在构建项目时进展顺利。 Idk 为什么它在错误消息中显得有些奇怪。我的代码实际上没有任何问题。

错误信息如下所示:

The error message

CompileXIB /Users/saiful/Documents/test-ios/test/test/Base.lproj/RoomResultTableViewCell.xib(目标:测试) cd /Users/saiful/Documents/test-ios/test 导出 XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/.. /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module test --output-partial-info-plist /Users/saiful/Library/Developer/Xcode/DerivedData /test-bgtolzqqziiyvkfqjgwogitynwsj/Build/Intermediates.noindex/test.build/Debug-iphonesimulator/test.build/Base.lproj/RoomResultTableViewCell-PartialInfo.plist --auto-activate-custom-fonts --target-device iphone --minimum -deployment-target 9.0 --output-format human-readable-text --compile /Users/saiful/Library/Developer/Xcode/DerivedData/test-bgtolzqqziiyvkfqjgwogitynwsj/Build/Products/Debug-iphonesimulator/test.app/Base.lproj /RoomResultTableViewCell.nib /Users/saiful/Documents/test-ios/test/test/Base.lproj/RoomResultTableViewCell.xib

但是当我尝试再次构建时,错误消息会抛出另一个 XIB 或故事板名称。

我已经尝试清理和重建。此外,删除派生数据并重新打开我的 Xcode。 我正在为我的项目使用 git。当我搬到另一个分支机构时,这是不是错过了什么?

【问题讨论】:

  • 即使我在 xcode 11.1 和 BigSur OS 中运行目标 c 项目时也遇到了同样的问题。有没有找到解决办法,告诉我

标签: ios swift xcode


【解决方案1】:

单击属性检查器的第一个选项卡。 滚动到界面生成器文档部分。 从下拉列表中尝试从 Opens in 下拉列表中更改 Xcode 版本。

【讨论】:

  • 是的,它从一开始就设置好了。并且仍然出现构建失败
  • 升级到 Xcode 11 时,我只有一个 XIB 文件(在我的项目中很多)无法编译,并出现“Command CompileXIB failed with a nonzero exit code”错误。将“打开方式”Xcode 版本从 Xcode 10 更改为 Xcode 11 为我解决了这个问题。谢谢!
【解决方案2】:

问题在于 XIB 的结构与 Xcode 所期望的结构不同。这可能是由 Xcode 的更新引起的。 @ayon.gupta 的答案应该将 xib 的结构更改为您当前 Xcode 需要的结构。我注意到,在 Xcode 的某些 beta 版本中,beta 版本不在下拉列表中,因此可能是您的情况。

【讨论】:

  • 您能建议一下,如何根据 xcode 更改 xib 格式吗?