SourceKitService Crashed

Xcode occasionally starts crashing on me and it won’t stop. Usually this is triggered by Xcode trying to actively compile my code while I’m typing. This crash triggers a cycle where it happens over and over and over. I get the message “SourceKitService Crashed Crashlog generated in ~/Library/Logs/DiagnosticReports Editor functionality temporarily limited.” as picture below.

The autocomplete and text coloring in Xcode breaks for about five seconds. The coloring and autocomplete functionality return for about one second before the crash happens again.

I initially ran into this in the beta builds of Xcode 6 and hoped they would be addressed, but here we are with the official release and this is still an issue. At first I would assume there was an error in my code and that Xcode was crashing instead of showing me the error. I came to realized that the crash happened without rhyme or reason. I could rollback my changes to a known good build and the crash wouldn’t go away.

The easiest way I’ve found to solve this is to delete the derived data. But simply deleting it from the organizer window in Xcode didn’t work for me. You can stop the issue by navigating to the following folder.

~/Library/Developer/Xcode/DerivedData/

Simply deleting the projects folder wouldn’t fix the problem for me (I think that’s what Xcode is doing). I also have to delete the ModuleCache folder in order to get rid of the issue. This is certainly annoying, but at least bearable now that I can fix it.

Written on October 6, 2014