界面生成器故事板编译器错误 Xcode

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

Interface builder storyboard compiler error Xcode

xcodecompiler-errors

提问by RyGuy

I downloaded Xcode and am getting "Interface builder Storyboard Compiler Error" when I try and run any project.

我下载了 Xcode,并在尝试运行任何项目时收到“界面构建器故事板编译器错误”。

So far to troubleshoot this I have(based off any similar threads): -cleaned the file -created a new blank file (which still gives the compiler error message) -uninstalled and reinstalled Xcode (Version 8.2.1) -tried installing Xcode 8.3 beta 5 (still gives me the same error)

到目前为止,我已经解决了这个问题(基于任何类似的线程): - 清理了文件 - 创建了一个新的空白文件(仍然会给出编译器错误消息) - 卸载并重新安装 Xcode(版本 8.2.1) - 尝试安装 Xcode 8.3 beta 5(仍然给我同样的错误)

so far nothing has fixed this error. Also I'm up to date on OS, running macOS Sierra version 10.12.3

到目前为止,没有任何东西可以修复这个错误。另外我是最新的操作系统,运行 macOS Sierra 版本 10.12.3

I am learning swift for work and am hoping to get this figured out soon.

我正在快速学习工作,并希望尽快解决这个问题。

Thank you!

谢谢!

(This is a picture of the Error code screenshot)

(这是错误代码截图的图片)

回答by Desmond DAI

Xcode 8.2.1:

Xcode 8.2.1:

  • quit Xcode
  • delete .xcuserdatadfolder inside xcuserdataof .xcworkspace(if using Cocoapods) or .xcodeproj
  • reopen Xcode, clean project and clean build folder (Under Productoption)
  • 退出 Xcode
  • 删除.xcuserdatad里面xcuserdata的文件夹.xcworkspace(如果使用 Cocoapods)或.xcodeproj
  • 重新打开 Xcode,清理项目和清理构建文件夹(在产品选项下)

That should be ok!

那应该没问题!

回答by stan

I had the same problem while trying to archive my app for the app store. I tried twice and same problem occurs.

我在尝试为应用商店存档我的应​​用时遇到了同样的问题。我试了两次,出现同样的问题。

Then i deleted the derived data, cleaned the project and restarted Xcode - THAT FIXED it.

然后我删除了派生数据,清理了项目并重新启动了 Xcode - 修复了它。

Hopefully this will help someone else

希望这会帮助别人

回答by AKIL KUMAR

I Solved the problem by cleaning the build folder.

我通过清理构建文件夹解决了这个问题。

Just use cmd + option + shift + k and then build the project by using cmd + B and hopefully solve the problem.

只需使用 cmd + option + shift + k ,然后使用 cmd + B 构建项目,希望能解决问题。

回答by Hima

I was having this error for xCode 9.

我在 xCode 9 上遇到了这个错误。

An .xib file was creating the error. What I did was,

.xib 文件正在创建错误。我所做的是,

  • removed .xib file
  • added it back to the project
  • cleaned and built the project
  • 删除了 .xib 文件
  • 将其添加回项目
  • 清理并构建项目

That solved my problem.

那解决了我的问题。

回答by Andrew Geisthardt

I also ran into this with XCode 9 Beta - 2, the quick nuke from orbit didn't fix it. Just check out the Log file it points you to and you can at least patch the offending issue, even if it a bug on Apple's end. For me, the TabBar didn't like an icon image, removed it for now and it Built fine.

我也用 XCode 9 Beta - 2 遇到了这个问题,轨道上的快速核弹没有修复它。只需查看它指向您的日志文件,您至少可以修补有问题的问题,即使它是 Apple 端的错误。对我来说,TabBar 不喜欢图标图像,暂时将其删除并且构建良好。

I'll try replacing it yet with another image. Apparently it doesn't like its own System-provided Images.

我会尝试用另一个图像替换它。显然它不喜欢它自己的系统提供的图像。

Exception name: NSInvalidArgumentException
Exception reason: System-provided UIImage instances cannot be encoded 
in NIBs - raised for instance '<UIImage: 0x7fd377eb4510>, {18, 20}'

回答by William T.

None of the above suggestions worked for me. After further research I found that I had dragged a segue (popover) from a button inside of a tableview cell.

以上建议都不适合我。经过进一步研究,我发现我从 tableview 单元格内的按钮拖动了一个 segue (popover)。

This is not allowed, as the touch anchor screen location is dynamic while the table scrolls.

这是不允许的,因为在表格滚动时触摸锚点屏幕位置是动态的。

I fixed the problem by anchoring the whole tableview instead and programmatically altering the popover arrow placement to be in line with the cell's button.

我通过锚定整个 tableview 并以编程方式更改弹出箭头位置以与单元格的按钮对齐来解决该问题。

回答by Jigar Tarsariya

I have solved this issue by following below steps:

我通过以下步骤解决了这个问题:

1. cmd + shift + k
2. cmd + option + shift + k
3. Restart Xcode
4. Restart you mac.

Hope this will also help you. Thanks!

希望这也能帮助你。谢谢!

回答by sabrefm1

I had this same error after updating to xcode 9.4. After doing a Product -> Clean and then Product -> Build still no luck. Then Done a clean again and restarted. After the reboot the build succeeded.

更新到 xcode 9.4 后,我遇到了同样的错误。在做了一个 Product -> Clean 然后 Product -> Build 仍然没有运气。然后再次清洁并重新启动。重启后构建成功。

回答by Tamás Sengel

I use Xcode 9.4.1 and Xcode 10 beta 4 on macOS 10.14 beta 4. I opened the project that threw this error in both versions of Xcode.

我在 macOS 10.14 beta 4 上使用 Xcode 9.4.1 和 Xcode 10 beta 4。我打开了在两个版本的 Xcode 中都抛出此错误的项目。

While removing different files from bundle resources, I also got several other errors, such as "Interface builder XIB Compiler Error" and "Failed to launch IBCocoaTouchImageCatalogTool via CoreSimulator spawn".

从捆绑资源中删除不同的文件时,我还遇到了其他几个错误,例如“接口构建器 XIB 编译器错误”和“无法通过 CoreSimulator spawn 启动 IBCcoaTouchImageCatalogTool”。

After trying every other solution I could find, what finally worked for me is reinstalling Xcode 9.4.1, reopening the project and cleaning the project/build folder.

在尝试了我能找到的所有其他解决方案后,最终对我有用的重新安装 Xcode 9.4.1,重新打开项目并清理 project/build 文件夹

I speculate that this happened because there were times when both Xcode versions were open simultaneously. The two versions use common files and the simultaneous usage possibly caused an internal inconsistency in the rendering of Interface Builder.

我推测这是因为有时两个 Xcode 版本同时打开。两个版本使用通用文件,同时使用可能会导致Interface Builder渲染的内部不一致。

回答by Fa.Shapouri

I had this problem too, in Xcode 11; In my case it happens after solving conflicts on .xcodeproject during merging code.

我也有这个问题,在 Xcode 11 中;在我的情况下,它发生在合并代码期间解决 .xcodeproject 上的冲突之后。

I followed below steps:

我按照以下步骤操作:

  1. Remove storyboard from reference of project.
  2. Select MyProject.xcodeproj and show content of that, then open project.pbxproj by Xcode or text.
  3. Search for storyboard name and removed all line contains that names.
  4. Build project
  5. Add storyboard to project.
  6. Build project again.
  1. 从项目参考中删除故事板。
  2. 选择 MyProject.xcodeproj 并显示其内容,然后通过 Xcode 或文本打开 project.pbxproj。
  3. 搜索故事板名称并删除所有包含该名称的行。
  4. 构建项目
  5. 将故事板添加到项目中。
  6. 再次构建项目。