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

I am getting this error on archive:

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

How to solve it?

Please see the screenshot.

error


This problem occurs when the Swift optimization level is not set to None for Release. Set the value to None and the issue goes away.

  1. Open up your project and click on the projects root directory.
  2. Click the build settings tab.
  3. Search for Swift Compiler - Code Generation and under Optimization Level make sure Release is set to None.

EDIT

After upgrading to Xcode 6.1 these instructions caused other issues when archiving (building for debug/device worked fine). Setting the optimization to Fastest allowed me to archive again. There are apparent issues with Swift compiling still (archiving specifically).

Can't archive working 6.0.1 Swift project in Xcode 6.1 / Segmentation fault: 11

EDIT I was not able to fund the Build Settings tab, until I read this answer.

how to find the build settings tab


This occurred for me when I had two of the exact same files, and also when I was missing I file I didn't know I had deleted. I clicked on the error message, and just above the error, it shows you what file you have more than 1 of or are missing.


You can click the Product in the navigation and choose the "Clean" button; it will clean all compile error in your project. Then, you can debug for the latest error.