I just downloaded the GM release of Xcode 6 and it won\'t compile with this error:
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault
In my case Xcode gave the error because of the following line :
if UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.Phone {
}else {
}
And to fix the error I've defined this :
enum UIUserInterfaceIdiom : Int {
case Unspecified
case Phone // iPhone and iPod touch style UI
case Pad // iPad style UI
}
And then i used it like :
if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
}
Good luck !
I was also getting this error. I ran the the command in Terminal as suggested by @Maxwell and found out the error was in my GameViewController.swift file. A little digging around and found that it didn't like some auto-generated code or the code conflicted with a setting in Xcode somewhere
override func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
if UIDevice.currentDevice().userInterfaceIdiom == .Phone {
return .AllButUpsideDown
} else {
return .All
}
}
As soon as I removed this block the error went away.
In my case i changed 3 places:
Target > Build Settings > Swift Compiler >
When i changed just Debug, i have errors like "Source Kit crashed...." This combination of parameters, works very good for me!
I think it occured for many reasons, what I have encountered is this situation,hope it could help you.
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) ){ [weak self] in
// ...
dispatch_async(dispatch_get_main_queue()) { [weak self] in
// ...
return
}
}
In the upper code,just delete "[weak self]" called capture list will remove the compiler error. It works for me.
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) ){ [weak self] in
// ...
dispatch_async(dispatch_get_main_queue()) {
// ...
return
}
}
xCode version is 6.1.1
Encounter this error when compiling this Swift 2.0 syntax in Xcode 6.4:
print(string, appendNewline: true);
Back to Xcode 7 and the error is gone.
In my case this error was caused by the incorrect (UTF8) .swift file encoding; Solved by copy-pasting the file's contents into a new file.