Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am going through the process of updating my swift project to Swift 2.0 on Xcode 7. The following error is being reported by xcode on building the project:

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

This happens on either SwiftyJSON or SwiftSpinner frameworks (the compiler seems to pick one first at random and fail, so the error gets reported intermittently on either or the other). I have updated these frameworks to their xcode7/swift2 compatible branches but the project still fails to compile.

Just wondering if this is a situation other people are seeing when upgrading their project with cocoa pods framework dependencies, or if this is a compiler bug

like image 668
Luis Delgado Avatar asked Sep 18 '15 08:09

Luis Delgado


2 Answers

For others with a similar problem try this: Open Console (not terminal) and choose All Messages. Then try to build your Xcode project and when it fails take a look in the list there with any message that could be related to Xcode.

I found a message like this:

01/10/15 10.24.17,808 Xcode[53145]: DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-8228/IDEFoundation/Playgrounds/IDEPlaygroundAuxiliarySourceCompilerOperation.m:311 Details: Unable to read diagnostics from file "/Users/username/Library/Developer/Xcode/DerivedData/OurProject-diexylwajzhwgtfqdwiphjgzdwcy/Build/Intermediates/OurProject.build/Debug-iphoneos/OurProject.build/Objects-normal/armv7/CheckoutUserDataAdapter.dia" (Invalid File): Invalid diagnostics signature Function: void XCGenerateDiagnosticsFromFile(NSString *__strong, NSString *__strong, NSDictionary *__strong, NSDictionary *__strong, IDEActivityLogSectionRecorder *__strong, BOOL (^__strong)(IDEActivityLogMessage *__strong)) Thread: {number = 250, name = (null)} Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.

This gave us info that the error was in CheckoutUserDataAdapter.swift. After trial and error we found that the problem was it was calling a method from its super class that it overrides from its super class. Somehow it could not find the correct method.
We fixed it by adding super.methodCall() in CheckoutUserDataAdapter.swift - but that of cause should not be needed. I have filed a bug report.

like image 145
Morten Holmgaard Avatar answered Sep 28 '22 08:09

Morten Holmgaard


Check Build Phases - Compile Sources for deleted files, or files with a blank icon, once this file was removed the error was gone

like image 37
Dug Avatar answered Sep 28 '22 06:09

Dug