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

I am reviewing the process of upgrading my quick project to Swift 2.0 on Xcode 7. The following error is reported by xcode when building the project:

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

This happens either in SwiftyJSON environments or in SwiftSpinner (the compiler apparently selects the first one randomly and fails, so the error message is periodically reported on one or another). I updated this framework to my xcode7 / swift2-compatible branches, but the project is still not compiling.

It’s just interesting if this is a situation that other people see when updating their project using cocoa pods framework dependencies, or if it is a compiler error

+5
source share
3 answers

For others with a similar problem, try the following: Open a console (not a terminal) and select "All Messages." Then try to create your Xcode project, and when it doesn’t work, look at the list there with any message that may be related to Xcode.

I found the following message:

01/10/15 10.24.17,808 Xcode [53145]: DVTAssertions: warning in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-8228/IDEFoundation/Playgrounds/IDEPlaygroundAuxiliarySourceCompilerOperation.midance11 Details: diagnostic cannot be read from the file "/Users/username/Library/Developer/Xcode/DerivedData/OurProject-diexylwajzhwgtfqdwiphjgzdwcy/Build/Intermediates/OurProject.build/Debug-iphoneos/OurProject.build/ObarmsdndoperDaoperDaimeDnopaDaMeDaLaDeMeDaDeMeDaDeMeDeLaDeMeDaDeMeDeMeDeme : Invalid diagnostic signature Function: void XCGenerateDiagnosticsFromFile (NSString * __ strong, NSString * __ strong, NSDictionary * __ strong, NSDictionary * __ strong, IDEActivityLogSectionRecorder * __ strong, BOOL (^ __ strong) (IDEActivityLogMessage) * * * strong number = 250, name = (null)} Please specify ie error in http://bugreport.apple.com with this warning message, and any useful information that you can provide.

This gave us information that the error was in CheckoutUserDataAdapter.swift. After trial and error, we found that the problem was calling the method from the superclass, which it overrides from its superclass. Somehow, he could not find the correct method.
We fixed this by adding super.methodCall () to CheckoutUserDataAdapter.swift - but this should not be necessary. I published a bug report.

+9
source

Check build phases - compile sources of deleted files or files with a blank icon, as soon as this file was deleted, the error disappeared

+4
source

Thanks @Dug for the hint of the build phase. I ended up going in a different direction than deleting ...

After checking the assembly phases - compile the sources, find the files that are grayed out (currently they do not have a link to the actual file) to determine the files in question.

If the files are still in use, find them in the Project Navigator (left column) and you will see that they are colored red because Xcode has only a link, not a location for the actual file.

Select each red file, and then go to the file inspector (right column). You will see "Location". Find the files by clicking on the gray folder and finding them in the file structure outside of Xcode.

If you are working with a repo, it may be easier for you to simply delete the red files, choose File> Add Files To ... and just add them so that the link is more general and does not point directly to the location of your machine file.

This happened to me after merging the project file, in which I was forked for a long time from the main repo, so several places in the files were lost in the merger.

+2
source

All Articles