xcode 如何修复 ibtool 因 Main.storyboard 错误而失败:shouldBeArchived unrecognized

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

How to fix ibtool failed with Main.storyboard error: shouldBeArchived unrecognized

iosxcodeswiftbuildibtool

提问by tinkl

I have never encountered this problem before. The application used to run perfectly but now it always says this error. I have tried cleaning and rebooting. I have tried resetting IOS Simulator. I have tried deleting derived data.

我以前从未遇到过这个问题。该应用程序曾经完美运行,但现在总是提示此错误。我试过清理和重新启动。我曾尝试重置 IOS 模拟器。我试过删除派生数据。

This is what xcode build it says:

这就是 xcode build 它所说的:

CompileStoryboard AITEST/Base.lproj/Main.storyboard
cd /Users/tinkl/Documents/project-xcode/testProject/AITEST
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:(null)/Users/tinkl/.gem/ruby/2.0.0(null):(null)/Library/Ruby/Gems/2.0.0(null):(null)/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0(null):/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool --target-device iphone --errors --warnings --notices --module AITEST --minimum-deployment-target 8.1 --output-partial-info-plist /Users/tinkl/Library/Developer/Xcode/DerivedData/AITEST-eyqkoubdyxykegdhwecchlxhuetf/Build/Intermediates/AITEST.build/Debug-iphonesimulator/AITEST.build/Main-SBPartialInfo.plist --auto-activate-custom-fonts --output-format human-readable-text --compile /Users/tinkl/Library/Developer/Xcode/DerivedData/AITEST-eyqkoubdyxykegdhwecchlxhuetf/Build/Products/Debug-iphonesimulator/AITEST.app/Base.lproj/Main.storyboardc /Users/tinkl/Documents/project-xcode/testProject/AITEST/AITEST/Base.lproj/Main.storyboard

2015-06-16 10:44:10.053 ibtoold[20616:447845] -[IBUIViewControllerAutolayoutGuide shouldBeArchived]: unrecognized selector sent to instance 0x7fdd8d4b0d40
/* com.apple.ibtool.errors */
/Users/tinkl/Documents/project-xcode/testProject/AITEST/AITEST/Base.lproj/Main.storyboard: error: Exception while running ibtool: -[IBUIViewControllerAutolayoutGuide shouldBeArchived]: unrecognized selector sent to instance 0x7fdd8d4b0d40

run system:

运行系统:

1 : OS X EL Capitan version, 10.11

1:OS X EL Capitan 版本,10.11

2 : XCode Version 6.1 (6A1052c)

2 : XCode 6.1 版 (6A1052c)

3 : command tools version 6.1

3:命令工具版本 6.1

Any help for this would be great. I also have quite a large storyboard. Does that matter?

对此的任何帮助都会很棒。我也有一个相当大的故事板。这有关系吗?

Thanks in advance!

提前致谢!

Other Reault:

  1. if checked stroyboard's UIViewController's autoLayout to off, will build Success.

  2. if use UITableViewController in storyboard use autolayout to on, will build Success.

其他雷诺:

  1. 如果选中 stroyboard 的 UIViewController 的 autoLayout 关闭,将构建成功。

  2. 如果在情节提要中使用 UITableViewController 使用自动布局打开,将构建成功。

here ibtool version:

这里 ibtool 版本:

tinkl:~ tinkl$ ibtool --version

tinkl:~ tinkl$ ibtool --version

bundle-version 1878 short-bundle-version 6.1

捆绑版本 1878 短捆绑版本 6.1

回答by ryachart

This issue was resolved for me after updating my Xcode version.

更新我的 Xcode 版本后,此问题已为我解决。

I ran into this issue after working on a project on in an older version of Xcode and upgrading to El Capitan without then upgrading Xcode.

我在旧版本的 Xcode 中处理一个项目并升级到 El Capitan 而没有升级 Xcode 后遇到了这个问题。

After upgrading Xcode again, it worked.

再次升级Xcode后,它工作了。

回答by Duncan Dean Scholtz

I couldn't get this to work either but what I did was symlink to a newer version of Xcode. I linked 6.3.2to 6.2.0. I am not sure of the implications of doing this.

我也无法让它工作,但我所做的是符号链接到较新版本的 Xcode。我链接6.3.26.2.0. 我不确定这样做的影响。

ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool /Applications/Xcode_6.2.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool

ln -s /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool /Applications/Xcode_6.2.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool

回答by Nikita Sharma Sahu

This issue usually occurs when you copy any UI from storyboard to XIB or vice-versa. Once you copy any thing cross check if the things are supported in XIB, like if I copy anything from storyboard to xib file, then there are many thing which are not supported (obviously because storyboard is a newer version of xib) and simple example for this is tableview prototype cell.

当您将任何 UI 从故事板复制到 XIB 或反之亦然时,通常会发生此问题。一旦你复制了任何东西,交叉检查这些东西是否在 XIB 中受支持,比如如果我将任何东西从故事板复制到 xib 文件,那么有很多东西不受支持(显然因为故事板是 xib 的更新版本)和简单的例子这是 tableview 原型单元格。

So just remove those unsupported things from UI and thats it. It will start working again.

所以只需从 UI 中删除那些不受支持的东西,就是这样。它会重新开始工作。

回答by Saranjith

This error is caused due to un-matching of size of storyBoard designed by you and of simulator. This can be solved in two ways, by changing size of storyBoard or by de-selecting autolayout option. Autolayout is to place tools as it as in every resolutions. So when mismatching occurs. supposed to be trimmed to fit in screensize. That is the reason behind this error.

此错误是由于您设计的 storyBoard 与模拟器的大小不匹配造成的。这可以通过两种方式解决,通过改变 storyBoard 的大小或通过取消选择自动布局选项。自动布局是在每个分辨率中放置工具。所以当出现不匹配时。应该修剪以适应屏幕大小。这就是这个错误背后的原因。