Build fails with “Command failed with a nonzero exit code”

前端 未结 30 2436
栀梦
栀梦 2020-11-28 09:15

When I try to build my app with Xcode, an error interrupts the build process:

Command CompileStoryboard failed with a nonzero exit code

相关标签:
30条回答
  • 2020-11-28 09:38

    What helped to me is to set Compilation Mode to Incremental for all configurations in Target's Build Settings. With Whole module compilation mode I got errors. But this setting made project build slower.

    0 讨论(0)
  • 2020-11-28 09:38

    If you are facing an error like that on new MacOS version.

    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

    It means that you need to install XCode command line, open a Terminal and run this command:

    $ xcode-select --install

    0 讨论(0)
  • 2020-11-28 09:39

    Closing Xcode for me didn't have an effect. Instead, I cleaned the project using CommandShiftK.


    I also found another reason: I had a storyboard reference to another storyboard which I had removed. The quick fix was deleting this.

    0 讨论(0)
  • 2020-11-28 09:40

    I had the same error Restarting Xcode and Recompiling Fixed the issue for me.

    0 讨论(0)
  • 2020-11-28 09:43

    If you have multiple targets, where two or more targets have files with the same name, check the target membership of those files in Files inspector. The error occurs when multiple instances of the equally named file have set the target membership for the same target.

    0 讨论(0)
  • 2020-11-28 09:43

    I have the issue like that and my solution is change a little thing in Build Settings:

    SWIFT_COMPILATION_MODE = singlefile;
    SWIFT_OPTIMIZATION_LEVEL = "-O";
    

    it work to me

    0 讨论(0)
提交回复
热议问题