Xcode 卡在索引上
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13831559/
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
Xcode stuck on Indexing
提问by tomDev
A project I've been working for 2 months stopped working for no reason because Xcode got stucked on "Indexing". I can't Build the project anymore. If I try to build, Xcode freezes and I have to force quit. This happens only with this project.
我已经工作了 2 个月的一个项目无缘无故地停止工作,因为 Xcode 被困在“索引”上。我不能再构建项目了。如果我尝试构建,Xcode 会冻结,我必须强制退出。这只发生在这个项目中。
I tried cleaning all derived data but didn't help.
我尝试清理所有派生数据,但没有帮助。
I'm using Xcode 4.5.2.
我正在使用 Xcode 4.5.2。
Any ideas?
有任何想法吗?
回答by Pratik Mistry
- Open your Project Folder.
- Find ProjectName.xcodeproj file.
- Right-Click Copy and Paste to Safe Place.
- Right-Click Show Package Contents.
- Find project.xcworkspace file and delete that file.
- Reopen Your Project and clean and Rebuild.
- 打开您的项目文件夹。
- 找到 ProjectName.xcodeproj 文件。
- 右键单击复制并粘贴到安全位置。
- 右键单击显示包内容。
- 找到 project.xcworkspace 文件并删除该文件。
- 重新打开您的项目并清理和重建。
If your problem is not solved then replace the file with your backup file.
如果您的问题没有解决,则用您的备份文件替换该文件。
回答by Aleksandar Vaci?
- Close that project from Xcode
- Open Xcode Organizer, find the problematic project
- Delete Derived Data folder in the Organizer
- Close/re-open Xcode
- 从 Xcode 关闭该项目
- 打开Xcode Organizer,找到有问题的项目
- 删除管理器中的派生数据文件夹
- 关闭/重新打开 Xcode
Nuking Derived Data is the first thing to try in all cases of Xcode misbehaving
Nuking Derived Data 是在所有 Xcode 行为不端的情况下首先要尝试的事情
回答by Jehan
I had this exact problem, it was caused by a 20 item array literal. Had to switch to different syntax. Pretty silly.
我有这个确切的问题,它是由 20 项数组文字引起的。不得不切换到不同的语法。挺傻的。
回答by kjian
- Close any opened Xcode
rm -rf ~/Library/Developer/Xcode/DerivedData
- Right click your PROJECT_NAME.xcworkspace, choose 'show content', and delete 'xcuserdata' folder
- 关闭任何打开的 Xcode
rm -rf ~/Library/Developer/Xcode/DerivedData
- 右键单击您的 PROJECT_NAME.xcworkspace,选择“显示内容”,然后删除“xcuserdata”文件夹
回答by Philipp Otto
I had a similar problem, and found that I accidentally defined a class as its own subclass. I got no warning or error for this but the compiling got stuck.
我也遇到过类似的问题,发现不小心把一个类定义为自己的子类。我没有收到任何警告或错误,但编译卡住了。
class mainClass : mainClass
{
...
}
回答by oarfish
When using Xcode 6 and it says
使用 Xcode 6 时,它说
Waiting for make
等待制作
It might be that an instance of make is already running. Kill the process and indexing proceeds. Silly, but worked for me.
可能是 make 的一个实例已经在运行。终止进程并建立索引。愚蠢,但对我有用。
回答by greencardigan
Another thing to try if your trying to solve indexing issues and you're this far down the page!
如果您试图解决索引问题,而您在页面的下面这么远,则可以尝试另一件事!
Try adding this flag to your build settings.
尝试将此标志添加到您的构建设置中。
-Xfrontend -warn-long-expression-type-checking=400
-Xfrontend -warn-long-expression-type-checking=400
It will cause warning where the compiler take a long time to deduce a complex expression.
如果编译器需要很长时间来推导复杂的表达式,则会引起警告。
This may cause a build error which will go away after you find the slow expressions and then remove the build flag.
这可能会导致构建错误,在您找到慢表达式然后删除构建标志后,该错误将消失。
回答by ooOlly
回答by Saeed Ir
It's a Xcode bug (Xcode 8.2.1) and I've reported that to Apple, it will happen when you have a large dictionary literal or a nested dictionary literal. You have to break your dictionary to smaller parts and add them with append method until Apple fixes the bug.
这是一个 Xcode 错误(Xcode 8.2.1),我已经向 Apple 报告了,当您有一个大字典文字或嵌套字典文字时,就会发生这种情况。你必须把你的字典分成更小的部分,然后用 append 方法添加它们,直到 Apple 修复了这个错误。
回答by rogger2016
Hold alt > Product > Clean Build Folder
按住 alt > Product > Clean Build Folder