错误 Xcode 6 --> 错误 SourceKit 终止。编辑器功能暂时受限

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24063055/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:00:50  来源:igfitidea点击:

Error Xcode 6 --> Error SourceKit terminated. Editor functionality temporarily limited

xcode

提问by dpbataller

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

有时我在 Xcode 6 中遇到此错误并且画布变成白色。

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

在此处输入图片说明我是唯一发生这种情况的人,还是一个错误?

回答by Meng Zhang

I still have this issue.

我仍然有这个问题。

I have a working solution:

我有一个可行的解决方案:

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

如果您的目标是 iOS8,请将部署目标切换到 iOS7,

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

如果再次出现此问题,请将部署目标切换到iOS8,

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

如果再次出现此问题,请将部署目标切换到iOS7,

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

如果再次出现此问题,请将部署目标切换到iOS8,

...

...

...

...

...

...

Hope this help you.

希望这对你有帮助。

Update:

更新:

Seems this is better solution:

似乎这是更好的解决方案:

Quite Xcode, and delete all the foldersin the DerivedData directory

相当Xcode,并删除DerivedData目录中的所有文件夹

回答by ZYiOS

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.

我使用 Xcode 6 beta5,当我声明成员为惰性时,当我输入新行时会显示此错误。当我删除关键字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

[更新]如果你的 [PROJECT_NAME]-Bridging-Header.h 导入了一个不存在的头文件,SourceKitService 将经常被终止

回答by Maury Markowitz

SourceKit appears to simply be very, very bad.

SourceKit 似乎非常非常糟糕。

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.

上面的问题列表包含许多可能的原因;测试版软件、跨版本更新代码(在一个版本中创建,在另一个版本中编辑)、IB 连接问题、桥接或覆盖和/或延迟问题。

Well I'm using the releaseversion 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.

好吧,我使用的是 Xcode 6.1的发行版。代码是在这个版本中创建的。没有一次使用覆盖、懒惰或桥接。它进行文件处理,并且没有单个 IB 连接(还)。代码完全致力于打开文本文件并解析它们,使用最基本的 Cocoa 原语,主要是 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)

SourceKit 每隔几分钟就会崩溃一次。它经常和随机地崩溃,我无法确定任何类型的模式。一个问题似乎是,如果现有代码行包含对一种类型的引用,然后更改为另一种类型,但这绝对不是万无一失的,也不是唯一的原因。(更新:现在每 10 次左右击键就会崩溃)

回答by JTerry

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!

我在使用 xcode 6 beta 6 时遇到了问题。我终于将 iOS 部署目标从 7.0 更改为 7.1,我的问题就消失了!

回答by behicsakar

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

2014 年 12 月 2 日发布的与此错误相关的更新。

Please make sure your xcode latest.

请确保您的 xcode 是最新的。

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

回答by Rohit

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 betaand enjoy coding...

您应该向 Apple 报告一个错误,因为 Xcode 处于 beta 模式,所以不要指望它可以正常工作。虽然在我的情况下有很多时候会发生这种情况,但它是随机发生的,或者是通过在 [] 之间编写一段代码来发生的。下载最新版本的Xcode 6 beta并享受编码...

回答by Vinay Jain

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.

当我将 Xcode6 从 beta 3 更新到 beta 4 时,我遇到了这个问题。Xcode6 beta 4 的 IBOutlet 声明有所不同,并将 Xcode6 beta 3 的 IBOutlet 声明视为错误。当我用 beta 4 更改声明(Xcode beta3)时,这个 SourceKit 服务错误弹出。

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.

把tableview的delegate和datasource的方法全部去掉,重新写一遍。现在一切正常。

回答by D.A.H

I can confirm that this command on terminal solves it

我可以确认终端上的这个命令解决了它

rm -rf ~/Library/Developer/Xcode/DerivedData/ModuleCache

回答by Stefan

.. 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

..删除DerivedData文件夹的所有内容..显然有基于项目的文件,moduleCache可能是一般的,通过只删除moduleCache,问题仍然存在于基于项目的文件中