XCode 6 GM: Constantly freezing / locking while editing Swift code

 ̄綄美尐妖づ 提交于 2019-12-30 20:30:00

问题


Since installing XCode 6 GM, it has been freezing and locking, showing the spinning wheel of death while I attempt to edit code that has syntax errors. Has anyone else seen this, and are there any known work-arounds?

I foolishly abandoned my cautious strategy of saving the previous version (Beta 7) and it appears that Beta 7 is no longer available for download. Are there any known archives of / for the link?

I have also posted to the dev forums and will follow up with a bug report, but it is hard to pin down the exact circumstances.

Edit:

Additonal Notes:

CPU: SourceKit Service is generally around 100%, but that has seem to have been the norm for the flavors of XCode, and the CPU seems to properly drop off when it finishes recompiling.

RAM: SourceKit is no longer exhibiting the memory leaks that used to cause it to halt and catch fire, memory does not appear to be a factor, and there are several ~ 5+ gigs to spare.

Environment:

Late 2012 Mac Mini, 16GB RAM OS X 10.9.4 (to be fair, this was new today as well, driven by the requirements of XCode 6 GM).

That said, only the software changed today.

Update

Apple claims that this bug is fixed in Beta 6.1, for what it's worth.


回答1:


You should look if you have any imports missing in your bridging header file. Sometimes even commented out imports will cause this behaviour. For me it was commented out Pixate Freestyle Cocoa Pod. I had to remove pod completely from my project to stop SourceKitService from crashing.

https://stackoverflow.com/a/25173389/527539




回答2:


I can't say any of these fixed the issue, but they alleviated the situation:

  1. I removed all playgrounds from the project tree. Saved them somewhere else.
  2. I removed all objectiveC code from the swift project (when possible). This Spinning-wheel, BTW, is a problem only in my swift projects. My other Objective-C-only projects are fine.
  3. It looks like it's the background indexing process which is taking all the CPU. Open "Activity Monitor" and see it right there at the top, using 360% CPU. Lowering the priority for this process helped as well (type in terminal):

    renice 10 -p [pid]

    Make sure to take the correct process id from Activity Monitor. The higher the number (should not exceed 19) the lower the priority.

  4. I make significant changes one at a time. It seems that the amount of errors in the file affect how many times and for how long the spinning wheel spins. It looks like some type of errors trigger it more often than others, but I'm not able to pin point which exactly.

XCode had a similar indexing issue in previous versions (see this Xcode4 issue: How to disable indexing in Xcode 4?) which gives me the hope they will fix this issue sometime, hopefully soon...




回答3:


I create a new tab via menu File->New Tab and close the old tab that is frozen.

CmdT does not work that time.



来源:https://stackoverflow.com/questions/25800860/xcode-6-gm-constantly-freezing-locking-while-editing-swift-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!