17

I need to find a solution to the super awesome "Source Kit Crashing" error with Swift. I have read many stack overflow posts but it doesn't seem like anyone has a solution. If there is a single line of code causing the problem there is no way I will find it by fishing through 50 + source files. Does anyone have a solution to this problem?

Xcode is essentially as useful as notepad it has gotten so bad. Please someone have a solution :). Source Kit crashes every single time I type a letter in any file.

Included Frameworks: Parse, Layer, Fabric, Various apple frameworks

Note: My app compiles and run completely fine

DBoyer
  • 3,062
  • 4
  • 22
  • 32

2 Answers2

34

You've probably tried all this, but just in case:

  1. close Xcode
  2. remove '~/Library/Developer/Xcode/DerivedData/'
  3. remove '~/Library/Caches/com.apple.dt.Xcode'
  4. restart your computer (just in case).

This should bring you code completion back, but the problem will eventually return. Xcode 6.1.1 beta (or now 6.2 beta with WatchKit) should fix many of the SourceKit related problems.

zisoft
  • 22,770
  • 10
  • 62
  • 73
Ivica M.
  • 4,763
  • 1
  • 23
  • 16
3

Dec 2, 2014, Apple deployed an update Xcode 6.1.1 that addressed the common source kit issue! For anybody who is coming across this issue.

Josh
  • 4,894
  • 6
  • 34
  • 42
kareem
  • 903
  • 1
  • 14
  • 36
  • It was really annoying !!! I hope it really solves this issue – Leo Dabus Dec 03 '14 at 07:02
  • 11
    I didn't notice a single improvement with Xcode 6.1.1 GM or 6.1.1 Mac App Store release. I'd even say it is worse than it was in beta. – Max Desiatov Dec 03 '14 at 22:16
  • 1
    Agreed, it's even worse in my case. It's hard to write any code in Swift at this point, it's slowing down to a crawl and crashing constantly. Clearing derived data only acts as a very short term fix, soon enough it reverts back to these issues. – ajeetdl Dec 09 '14 at 04:08
  • 1
    6.1.1 made my activity monitor report SourceKitService at 150-300% cpu usage. Very annoying. – khanh.tran.vinh Dec 17 '14 at 20:34
  • There is a known / public issue with larger swift projects, anywhere from 4-10 KLOC where it halts and catches fire. Cocoapods 0.36-Beta.2 is almost barely ready to break things into smaller frameworks, if that is any help. (see issue #3092). I am using it right now, FWIW. And off topic but useful, you can get more symbols if you derive from NSObject (non pure Swift code) – Chris Conover Feb 06 '15 at 06:38
  • 1
    Have Xcode 6.2 still and still seeing these crashes...a lot. – Scooter Mar 30 '15 at 03:51
  • 6.3 still has these issues,its sad that you not only pay 99$/year, buy an expensive device to what avail! Make me miss eclipse,simple elegant and works like a charm! Apple has no respect for developers it seems... – LoveMeow Jun 04 '15 at 21:39
  • I had this issue today. XCode 9.2 (9C40b) ... My macbook was crashing / rebooting as soon as XCode restarted. Deleting DerivedData and Caches solved it. (SourceKit was the culprit in the crash report.) – ocodo Apr 19 '18 at 07:11