Command CompileSwift failed with a nonzero exit code in Xcode 10 [duplicate]

For me, just cleaning project works using ShiftCommandK & OptionShiftCommandK.


You're most likely not reading the entire error message. If you look above the "Command CompileSwift failed with a nonzero exit code" message you should find some specification like this:

enter image description here

In this example I had two files with the same name. Once I fixed it everything worked as it should.


Currently my build is working. Here you are the steps I tried until it finally worked:

  1. Search in the whole project the word CommonCrypto.
  2. If you have a Pod containing that header import, remove this Pod from the Podfile and perform a pod install.
  3. Clean and build the project.
  4. Add again the Pod to the Podfile and perform a pod install.
  5. Clean and build the project again using a real device if possible.

And If you don't have that Pod, maybe you can try by making the same steps with some old Pod that you may encounter in your project.

Added information: also If you have some code error inside a Pod, first you need to solve that code problem and then try to compile again the project.

I'm going to copy the changes made in my project.pbxproj. I know it's not very helpful but it's the only thing that have changed in the git difference commit:

Removed: BDC9821B1E9BD1B600ADE0EF /* (null) in Sources */ = {isa = PBXBuildFile; };
Added:   BDC9821B1E9BD1B600ADE0EF /* BuildFile in Sources */ = {isa = PBXBuildFile; };

I hope this can help,

Regards.