error build: Command SwiftCompile failed with a nonzero exit code

after update to xocde14, build my old project , and get error build: Command SwiftCompile failed with a nonzero exit code.

Is there any indication of where in your code the compile failed? We're going to need a lot more info that one sentence if you want help.

And the build log doesn't have any clue as to where the failure occurs? Maybe you could post the build log here? (redact anything person if you need to.)

This specific error points to a bug in the Swift compiler. I have it happening on my app, with a handful of files, but intermittently. My build server has the same code checked out 5 times, with three checkouts building and the other two failing. I suspect once the file builds successfully and gets cached in Derived Data, the problem will go away until it is recompiled.

What you can do to identify the error is:

  1. Click on "Command SwiftCompile failed with nonzero exit code" in the Issues navigator. This will open the build log, selecting the error.
  2. Look at the file above it the error, in my case "Compiling ExtractedEvent.swift", which has a error indicator to the right and a grey exclamation point to the left.
  3. Click on the four line hamburger icon on the far right side to open the output.

You should see something like:

SwiftCompile normal x86_64 Compiling\ ExtractedEvent.swift /path/to/file
  cd ...

Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project and the crash backtrace.

Stack dump:
...

This means the compiler is broken and you should file the bug as directed.

What's working for me for now is to just keep hitting build until the error goes away.

i can run the project successfully, but the error is still present in the xcode left navigation bar. error content: Command SwiftCompile failed with a nonzero exit code

Hi,

Was you able to solve it for Xcode 14+ versions. I am clueless it was working fine on Xcode 13 versions but not on Xcode 14. Since apple has made compulsory so we need to upgrade to Xcode 14. Please help.

The error is still present in xcode 15.0.1 (15A507)

Any update on this?, cause I've been facing an issue regarding, ionic and ios 17, Unexpected input file, Unknown dynamically requested build input cannot be found, and I was not able to build my app :(

Same issue

error build: Command SwiftCompile failed with a nonzero exit code
 
 
Q