Command CompileSwift failed with a nonzero exit code

How to fix 'Command CompileSwift failed with a nonzero exit code' in Xcode?