-1

I imported a new code into Xcode and I am getting this error:

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1.

How do you fix it?

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • About 60 duplicate questions: https://stackoverflow.com/search?q=%22swiftc%22+%22failed+with+exit+code+1%22+is%3Aq+created%3A..2018-02 – Cœur Dec 29 '18 at 06:49
  • Possible Duplicate: [Xcode 6.0.1 Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1](https://stackoverflow.com/questions/26156561/xcode-6-0-1-command-applications-xcode-app-contents-developer-toolchains-xcoded) – Cœur Dec 29 '18 at 06:53
  • Possible Duplicate: [Xcode 8.0 Command /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1](https://stackoverflow.com/questions/38764691/xcode-8-0-command-applications-xcode-beta-app-contents-developer-toolchains-xco) – Cœur Dec 29 '18 at 06:53
  • Possible Duplicate: [ERROR swiftc failed with exit code 1](https://stackoverflow.com/questions/38496582/error-swiftc-failed-with-exit-code-1) – Cœur Dec 29 '18 at 06:54
  • Possible Duplicate: [swift failed with exit code 1 while compiling in Xcode - possibly related to Bridging-Headers](https://stackoverflow.com/questions/25889723/swift-failed-with-exit-code-1-while-compiling-in-xcode-possibly-related-to-bri) – Cœur Dec 29 '18 at 07:12

1 Answers1

-1

Try cmd+alt+shift+k. This cleans your derived data and might fix the issue.

As far as I know there can be multiple reasons why a compiler fails. Although cmd+alt+shift+k will help most of the time. If this fails, then click on the error message and try to debug it.

For example in the image below, if you read the message, we get to know that, there has been a name duplication. Fixing the name duplication will fix the enter image description here

Cœur
  • 37,241
  • 25
  • 195
  • 267
Sanket Ray
  • 1,071
  • 1
  • 15
  • 24