【问题标题】:Xcode 5 storyboard compile failureXcode 5 故事板编译失败
【发布时间】:2013-12-13 15:40:22
【问题描述】:

我正在运行 Xcode 5 并为 iOS 7 构建。当我尝试构建此项目以进行归档时,我收到此错误。我在我的本地机器和我的詹金斯构建服务器上得到它。我已经浏览了故事板,但我没有找到任何导致此错误的原因。它在模拟器和设备上构建得很好。我什至不确定 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

【问题讨论】:

  • 你在使用 AutoLayout 吗?
  • 是的,我正在使用自动布局。
  • 是在 Storyboard 中使用它来调整您的内容还是根本不使用它?您可以尝试在 Storyboard 文件中禁用它,然后再次尝试存档。
  • 我正在用它来调整内容。我会尝试禁用它,看看它是否存档,即使它看起来不太好,只是为了隔离问题。
  • 查看项目导航器。你能发现任何以红色突出显示的文件吗?

标签: ios iphone objective-c xcode jenkins


【解决方案1】:

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

【讨论】:

  • 打开您的构建阶段并在 Copy Bundle Resources 下查看。查看所有文件并查看情节提要是否在此列表中出现两次。或者,如果它确实出现在 Copy Bundle Resources 阶段,则要解决此问题:打开 project.pbxproj 文件并搜索情节提要的名称。检查是否有什么地方看起来不合适,或者记录是否与不同的哈希值重复。
  • 非常感谢!在我的项目中,复制包资源中添加了两次启动情节提要,这导致了问题!
  • 就我而言,我没有看到在复制包资源中添加了两次情节提要。
  • 有趣的注释,我的项目也因合并失败而遇到同样的问题。臭名昭著的 Xcode 项目文件再次来袭!
【解决方案2】:

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

【讨论】:

    【解决方案3】:

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

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

    希望这对某些人有所帮助!

    【讨论】:

      【解决方案4】:

      删除故事板 ID 中的“/”解决了我的问题。

      【讨论】:

        【解决方案5】:

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

        【讨论】:

          猜你喜欢
          • 2012-12-09
          • 1970-01-01
          • 2015-06-17
          • 1970-01-01
          • 1970-01-01
          • 2013-10-16
          • 2020-09-22
          • 2012-05-18
          • 2013-09-25
          相关资源
          最近更新 更多