Xcode 5 故事板编译失败

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

Xcode 5 storyboard compile failure

iosiphoneobjective-cxcodejenkins

提问by Jeremy Lyman

I'm running Xcode 5 and building for iOS 7. When I try to build this project for archiving I get this error. I get it on my local machine and on my jenkins build server. I have gone through the storyboard and I am not finding any reason for this error. It builds just fine on simulator and device. I am not even sure what runtime.nib is though addEditHCPViewController.nib is reference to one of the View Controllers inside of the storyboard. Any ideas?

我正在运行 Xcode 5 并为 iOS 7 构建。当我尝试构建此项目进行归档时,出现此错误。我在我的本地机器和我的 jenkins 构建服务器上得到它。我已经浏览了故事板,但我没有找到此错误的任何原因。它在模拟器和设备上构建得很好。我什至不确定 runtime.nib 是什么,尽管 addEditHCPViewController.nib 是对故事板内的视图控制器之一的引用。有任何想法吗?

CompileStoryboard myApp/Profiles.storyboard
    cd "/builds/Company/workspace/myApp"
    setenv IBSC_MINIMUM_COMPATIBILITY_VERSION 6.1
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    setenv XCODE_DEVELOPER_USR_PATH /Applications/Xcode.app/Contents/Developer/usr/bin/..
    /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --minimum-deployment-target 6.1 --output-format human-readable-text --compile /builds/Company/workspace/myApp/build/Distribution-iphoneos/myApp.app/Profiles.storyboardc /builds/Company/workspace/myApp/myApp/Profiles.storyboard
/* com.apple.ibtool.document.warnings */
/builds/Company/workspace/myApp/myApp/Profiles.storyboard:jlW-RT-oUY: warning: 2 views are vertically ambiguous.
/builds/Company/workspace/myApp/myApp/Profiles.storyboard:1Qm-h4-IZr: warning: Position is ambiguous for "Picker".
/builds/Company/workspace/myApp/myApp/Profiles.storyboard:d8p-iA-2QW: warning: Frame for "Button" will be different at run time.
/* com.apple.ibtool.errors */
/builds/Company/workspace/myApp/myApp/Profiles.storyboard: error: Compilation failed. Unable to write to path: /builds/Company/workspace/myApp/build/Distribution-iphoneos/myApp.app/Profiles.storyboardc
    Underlying Errors:
        Description: The file ??úruntime.nib??ù doesn???t exist.
        Failure Reason: The file doesn???t exist.
        Underlying Errors:
            Description: The operation couldn???t be completed. No such file or directory
            Failure Reason: No such file or directory
        Description: ??úProfiles.storyboardc??ù couldn???t be removed.
        Failure Reason: The file doesn???t exist.
        Underlying Errors:
            Description: The operation couldn???t be completed. No such file or directory
            Failure Reason: No such file or directory

CompileStoryboard myApp/Profiles.storyboard
    cd "/builds/Company/workspace/myApp"
    setenv IBSC_MINIMUM_COMPATIBILITY_VERSION 6.1
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    setenv XCODE_DEVELOPER_USR_PATH /Applications/Xcode.app/Contents/Developer/usr/bin/..
    /Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --minimum-deployment-target 6.1 --output-format human-readable-text --compile /builds/Company/workspace/myApp/build/Distribution-iphoneos/myApp.app/Profiles.storyboardc /builds/Company/workspace/myApp/myApp/Profiles.storyboard
/* com.apple.ibtool.document.warnings */
/builds/Company/workspace/myApp/myApp/Profiles.storyboard:d8p-iA-2QW: warning: Frame for "Button" will be different at run time.
/builds/Company/workspace/myApp/myApp/Profiles.storyboard:jlW-RT-oUY: warning: 2 views are vertically ambiguous.
/builds/Company/workspace/myApp/myApp/Profiles.storyboard:1Qm-h4-IZr: warning: Position is ambiguous for "Picker".
/* com.apple.ibtool.errors */
/builds/Company/workspace/myApp/myApp/Profiles.storyboard: error: Compilation failed. Unable to write to path: /builds/Company/workspace/myApp/build/Distribution-iphoneos/myApp.app/Profiles.storyboardc
    Underlying Errors:
        Description: The file ??úaddEditHCPViewController.nib??ù doesn???t exist.
        Failure Reason: The file doesn???t exist.
        Underlying Errors:
            Description: The operation couldn???t be completed. No such file or directory
            Failure Reason: No such file or directory

回答by Jeremy Lyman

I found the answer to this. During a merge in git, the project file had not been merged properly and Profiles.storyboard was being included as a resource twice. When it tried to compile the same resource the second time, it would fail.

我找到了这个问题的答案。在 git 中合并期间,项目文件没有正确合并,并且 Profiles.storyboard 被作为资源包含两次。当它第二次尝试编译相同的资源时,它会失败。

回答by Bence Pattogato

I just Cleaned the project, then built it again, afterwards the error disappeared.

我刚刚清理了项目,然后再次构建它,之后错误消失了。

回答by Imran Ahmed

Just feel I should add that I had this problem for a while and had no clue how to solve it.

只是觉得我应该补充一点,我遇到了这个问题一段时间,但不知道如何解决它。

Turns out one of my Storyboard IDs had a slash in (/) which was causing the error. Removing this slash resolved the error!

原来我的一个故事板 ID 在 (/) 中有一个斜线,这导致了错误。删除此斜杠解决了错误!

Hope this helps some people!

希望这可以帮助一些人!

回答by uday augustin

Removing "/" in the storyboard Id is fixed my problem.

删除情节提要 ID 中的“/”解决了我的问题。

回答by john

@imran-ahmed solved the problem. I worked on this problem for a couple hours and finally found the comment about the '/' in a StoryBoard ID. A year later and the '/' in the StoryBoard ID still kills Xcode compile. That was my problem and simply deleting the '/' solved the problem.

@imran-ahmed 解决了这个问题。我在这个问题上工作了几个小时,终于在 StoryBoard ID 中找到了关于“/”的评论。一年后,StoryBoard ID 中的“/”仍然会终止 Xcode 编译。那是我的问题,只需删除“/”即可解决问题。