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:

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