13

Sometimes I get this error in Xcode 6 and the canvas turns white.

enter image description here Am I the only one this happens to, or is it a bug?

Mike
  • 9,765
  • 5
  • 34
  • 59
dpbataller
  • 1,197
  • 4
  • 12
  • 23

9 Answers9

9

I still have this issue.

I have a working solution:

If you are targeting on iOS8, switch the deployment target to iOS7,

If this issue happen again, switch the deployment target to iOS8,

If this issue happen again, switch the deployment target to iOS7,

If this issue happen again, switch the deployment target to iOS8,

...

...

...

Hope this help you.

Update:

Seems this is better solution:

Quite Xcode, and delete all the folders in the DerivedData directory

Meng Zhang
  • 191
  • 2
  • 5
  • 3
    would appreciate if you are specific and point exactly where is the derived data directory. – Ankish Jain Dec 02 '14 at 05:49
  • A better "better solution" would be to provide a specific path to the DerivedData while you're in the business of trying to help people, since you already have the context and we don't. – clearlight Feb 06 '15 at 15:24
  • 1
    Window menu->Projects->your project->Derived Data->"Delete…" button – whoKnows Oct 14 '15 at 12:08
6

I use Xcode 6 beta5, when I declare member as lazy, it will show this error when I enter new line. It works when I remove the keyword lazy.

class PointZoomingView : ZYZoomingView, CMPopTipViewDelegate
{
    private ***lazy*** var pointButtonList: [PointButton] = []

    var hwRate: Double! = 1

[UPDATE] If your [PROJECT_NAME]-Bridging-Header.h import a non existing header file, the SourceKitService will be Terminated frequently

ZYiOS
  • 5,204
  • 3
  • 39
  • 45
5

SourceKit appears to simply be very, very bad.

The list of problems above contains a number of possible causes; beta software, code being updated across releases (created in one version, edited in another), problems with IB connections, bridging or issues with override and/or lazy.

Well I'm using the release version of Xcode 6.1. The code was created in this version. There isn't a single use of overrides, lazy or bridging. It does file handling, and doesn't have a single IB connection (yet). The code is entirely devoted to opening text files and parsing them, using the most basic Cocoa primitives, mostly NSString.

SourceKit crashes every couple of minutes. It crashes so often and randomly I cannot determine any sort of pattern. One issue appears to be if an existing line of code contains a reference to one type and then changes to another, but that's definitely not sure-fire nor the only cause. (Update: crashes with every 10th or so keystroke now)

Maury Markowitz
  • 9,082
  • 11
  • 46
  • 98
  • 1
    I write in Sublime Text 3 and only compile in Xcode now... The experience just like coming back to 1980s and using only keyword highlightable Turbo C. – WeZZard Oct 31 '14 at 01:52
  • Latest Xcode, brand new 15" macbook, constant crashes. It's pretty miserable. I should probably just switch to sublime for all coding too :( – nflacco Nov 04 '14 at 20:28
  • I found some solace in re-downloading the entire 5.2 GB Xcode from the dev page. This appears to be an *older* version that what I had, which may be in error. Nevertheless, the number of crashes declined to about 1 every 5 minutes. Sadly, the time taken to crash increased. – Maury Markowitz Nov 05 '14 at 14:34
3

I was having a problem with xcode 6 beta 6. I finally changed the iOS Deployment Target from 7.0 to 7.1 and my problem went away!

JTerry
  • 139
  • 8
1

You should report a bug to apple as Xcode is in beta mode so don't expect it to work fine. Although there are many points at which this occurs in my case it was occurring randomly or by writing piece of code in between []. Download the latest version of Xcode 6 beta and enjoy coding...

Rohit
  • 1,189
  • 12
  • 23
1

an update released in Dec 2, 2014, related to this error.

Please make sure your xcode latest.

Xcode, Apple Version 6.1.1 Released Dec 2, 2014
Includes SDKs for OS X 10.10 Yosemite, OS X 10.9 Mavericks, and iOS 8.1

 - Fixed common causes of SourceKit crashes when working with Swift
 - Additional bug fixed and stability improvements
behicsakar
  • 220
  • 2
  • 9
0

Try rewriting the methods you have defined/overrided.

I faced this problem when I updated my Xcode6 from beta 3 to beta 4. Xcode6 beta 4 differs in the IBOutlet declaration and treats IBOutlet declarations of Xcode6 beta 3 as errors. When I changed the declarations(of Xcode beta3) with beta 4 this SourceKit Service error popped up.

What I did to fix my code :-

Removed all the methods of tableview delegate and datasource and write them again. Now everything works just fine.

Community
  • 1
  • 1
Vinay Jain
  • 1,653
  • 20
  • 28
0

I can confirm that this command on terminal solves it

rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache
D.A.H
  • 858
  • 2
  • 9
  • 19
0

.. delete all the Content of the DerivedData folder .. apparently there are project based files and moduleCache may be a general one, and by deleting only the moduleCache the problem can still remain in the project based files

Stefan
  • 762
  • 1
  • 8
  • 11