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

前端 未结 30 2435
栀梦
栀梦 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:27

    I got this error while trying to run my unit tests in a submodule. What I have done is:

    Change the simulator => Clean the project => Build the project => Run unit tests.

    After this, my unit tests ran without any issue.

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

    In my case it was renaming a file to an existing file in other folder(Group) by mistake, just rename it to what it was then the error disappeared

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

    This is a known issue with Swift 4.2 and Xcode 10. I found an article here that fixed it for me: https://github.com/Yummypets/YPImagePicker/issues/236

    In short, go to your projects build settings, and add a user defined setting named SWIFT_ENABLE_BATCH_MODE and set its value to NO.

    Previously, I tried each of the methods suggested here (rebuild, exit Xcode, clean and rebuild, purge Derived Data files). None of them worked.

    Once I added the user define build setting per the article, Swift then told me the true error. In my case, it was a missing }, but it could be any number of problems.

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

    For me the problem was that on my Podfile I didn't put use_frameworks!. I just uncomment that line, run pod install on the terminal again. And it got fixed.

    It was commented since the app was entirely made on Objective-C. Since the app now uses Swift I had to make that change on the Podfile

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

    Go to your projects build settings, and add a user defined setting named SWIFT_ENABLE_BATCH_MODE and set its value to NO.

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

    Since this issue looks to have dozens of possible solutions and the root cause could be very vague, I'll throw my situation into the ring. Half of my pods were failing with some sort of CompileSwiftSource failure, but only on archive. I was still able to build for device and simulator just fine. I tried a lot (if not all) of the solutions suggested here with no luck. One of the pods had a slightly different error before the CompileSwiftSource error so I went to updating and trying to fix that single pod. It was the Cache library for iOS which hadn't been updated in a while. There was a fork that resolved the issue with updating to Xcode 10.2 that I was able to update to and after that, all of the other issues took care of themselves. So look for a single outlier in your pods if you're getting a bunch of them erroring out and start there.

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