Xcode stuck in indexing

The project, which I worked on for 2 months, stopped working for no reason, because Xcode was stuck in Indexing. I can no longer build a project. If I try to build, Xcode freezes, and I need to get it to exit. This only happens with this project.

I tried to clear all the data received, but did not help.

I am using Xcode 4.5.2.

Any ideas?

+104
indexing xcode freeze
Dec 12 '12 at 1:50
source share
34 answers
  • one
  • 2
  • Open the project folder.
  • Find ProjectName.xcodeproj file.
  • Copy the right mouse button and paste in a safe place.
  • Right-click Show Package Contents.
  • Locate the project.xcworkspace file and delete this file.
  • Open your project clean and rebuild.

If your problem is not resolved, replace the file with the backup file.

+145
Dec 12 '12 at 7:17
source share
  • Close this project from Xcode
  • Open Xcode Organizer, find the problematic project
  • Delete Derived Data folder in organizer
  • Close / reopen Xcode

Nuking Derived Data is the first thing to try in all cases of failed Xcode

+61
Sep 13 '14 at 9:11
source share

I had this exact problem, it was caused by an array literal of 20 elements. I had to switch to a different syntax. Pretty stupid.

+21
Feb 17 '15 at 1:05
source share
  • Close any open Xcode
  • rm -rf ~/Library/Developer/Xcode/DerivedData
  • Right-click on PROJECT_NAME.xcworkspace, select "show contents" and delete the folder "xcuserdata"
+12
Sep 25 '17 at 8:31 on
source share

When using Xcode 6 and it says

Waiting for make

Perhaps the make instance is already running. Kill the process and indexing. Stupid, but worked for me.

+8
July 17. '15 at 20:37
source share

I had a similar problem, and I found that I accidentally defined the class as my own subclass. I have no warnings or errors, but the compilation is stuck.

 class mainClass : mainClass { ... } 
+8
Sep 08 '15 at 13:40
source share

Hold alt> Product> Clear Build Folder

+4
Jul 11 '16 at 13:38 on
source share

For me, completely closing Xcode and then restarting the project.

This is not a solution to the original question, I do not believe it, but another simple task is to delete files and folders, etc. Sign the response to this idea.

+3
Dec 04 '15 at 7:04
source share

This is an Xcode bug (Xcode 8.2.1), and I reported this to Apple, this will happen when you have a large literal in a dictionary or a nested dictionary. You need to break the dictionary into smaller parts and add them using the add method until Apple fixes the error.

+3
Feb 08. '17 at 8:01
source share

I had a similar problem in which Xcode would spend a lot of time indexing and often crash the project, after which I had to force-quit and restart Xcode. It was very unpleasant.

Then I noticed a warning in the project about the misappropriation of self as a delegate. Of course, there was no protocol in the class declaration. Please note that the OP code sample has a similar purpose (although it is impossible to tell from the example whether the protocol is correctly declared):

 leaderboardController.leaderboardDelegate == self; 

After resolving this warning (by correctly declaring the implemented protocol), Xcode stopped working erroneously. In addition, I should note that the project was carried out correctly, since the protocol methods were implemented. Just Xcode was unable to confirm that the protocol should actually be implemented by the class.

+2
January 10. '14 at
source share
  • Disconnect from the network first. Both your wired network and the wireless network should disconnect.
  • Second, kill the com.apple.dt.SourceKitService process. Then Xcode will start indexing again, not stuck.

enter image description here

+2
August 10. '17 at 11:19 on
source share

Another thing to try if you're trying to solve indexing problems and you're so far down the page!

Try adding this flag to your build settings.

-Xfrontend -warn-long-expression-type-checking=400

build settings flag

This will raise a warning when it takes a long time for the compiler to output a complex expression.

warning

This can cause a build error that will disappear after you find slow expressions and then remove the build flag.

+2
Apr 23 '18 at 21:32
source share

A similar problem occurred in Xcode 6.4. The progress bar showed that Indexing was "paused." Tried to delete project.xcworkspace and then remove Derived Data as described above. It doesn't seem to help. Noting that the posts above also offer warning fixes, and since I inherited this huge 180-warning project, I said to myself, "What the hell does this look like a good day to fix warnings." When I corrected the warnings, after half an hour, I noticed that the progress indicator Indexation increased from 10% to 20%. In an hour it was at the level of 50%, then for an hour to 80%, then in half an hour it was done! Conclusion: add “take a long lunch or sleep” to the above sentences.

+1
Jul 03 '15 at 23:21
source share

I had the same issue for Xcode 7.0 beta. In my case, the “Preparation Profile” and “Product Identifier” values ​​in “Build Settings” were different between PROJECT and TARGETS. I set the same values ​​for them. And I also used the same values ​​for TARGETS "appName" and "appNameTest". Then he closed the project and reopened it. This resolved my case.

+1
Sep 01
source share

In my case, deleting the derived data directory did not help. Apparently, I had a file locked by another process, because after closing several terminal and emacs windows and completing the package-based response process, everything was resolved.

+1
Mar 01 '16 at 2:31 on
source share

For me, I made a stupid mistake. I am writing a class as follows:

 class A: A { ....... } 

The class inherits itself, which causes freezing. There are no message prompts from Xcode.

+1
Oct 31 '16 at 12:14
source share

It happened to me. If you are using cocoapods do the following:

  1. Delete project.xcworkspace
  2. Reinstall containers using "pod install" on terminal
  3. He will create a new project.xcworkspace
  4. Open a new project.xcworkspace -> Clean -> Build
+1
Apr 02 '18 at 8:51
source share

I ran into this problem on some projects with Xcode 9.3.1, and in my case the problem is related to some fast code, which for some reason Xcode doesn't like. This problem is difficult to solve because it is difficult to find which file is causing the problem.

When I get this problem, I delete some files from the Xcode project (remove links) and I try to check if indexing works. My process for this

  1. Delete some files
  2. Close Xcode
  3. Open xcode
  4. If indexing is complete, try renaming any method, if the files you deleted probably have something strange for Xcode.

In my case, I had a class definition with a reactive extension in the same file, and for some reason he did not like Xcode, I moved the reactive extension to another file, and now indexing works fine.

+1
May 26 '18 at 10:28
source share

Nothing worked for me, my project is too large (merging objective c , c++ , swift and java files with j2obj). I turned off Xcode indexing and worked without code completion for several months (and this is a pain). But finally, I found a workaround. The idea is to index Xcode, but limit its CPU usage to an external tool, such as cputhrottle .

So first you need to install cputhrottle in terminal

cook cputhrottle installation

Then limit the Xcode indexing process as follows (20 = 20%),

sudo cputhrottle $ (pgrep -f com.apple.dt.SKAgent) 20

I disclosed my “solution” here with mode details: how to prevent Xcode using 100% processor when indexing large projects

+1
Dec 07 '18 at 9:26
source share

Also terminate the application. if you have another application working with your xcode, first stop it and you will continue indexing.

0
October 1. '14 at 2:52
source share

For me, the reason was that I opened the same file both in the main editor and in the assistant editor at the same time. As soon as I closed the assistant editor, he passed. (Version Xcode 7.2.1)

0
Mar 08 '16 at 22:52
source share

Close your Xcode, close any git client (source tree or terminal) if it is open, and finally restart the project.

0
May 28 '16 at 18:21
source share

I also ran into a problem. I noticed that I opened the same project twice.

So QuitXCode> Open the project and make sure that only one instance is open> Clean> CleanBuild folder in some cases> build.

He should work

0
Jun 02 '16 at 21:48
source share

Faced with this recently on Xcode 7.3.1, for me, I noticed that using RAM is 100% available for CleanMyMac3. The problem magically settled after rebooting my machine. In fairness, however, I already went ahead and tried the accepted-answer, so you want to do the same before restarting just in case :-)

0
Jul 18 '16 at 11:29
source share

I fixed this by simply uninstalling the application from my device and rebuilt.

0
Sep 07 '16 at 10:20
source share

I had the same problem in fast version 2.2

This is due to an overloaded function function

 func warnLog() { print("Warning line: \(#line) file: \(#file) ") } func warnLog<T>(input:T? = nil) -> T? { print("Warning line: \(#line) file: \(#file) ") return input } func warnLog<T>(input:T) -> T { print("Warning line: \(#line) file: \(#file) ") return input } 

all i need to do is remove one of the unused overloads

 func warnLog<T>(input:T? = nil) -> T? { print("Warning line: \(#line) file: \(#file) ") return input } 
0
Sep 17 '16 at 16:11
source share

I closed my xCode and reopened the project, solving my problem.

0
Jan 31 '17 at 8:25
source share

My thing: this is not a project.xcworkspace file, this is not a Derived Data folder.

I spent a lot of time. Worse, there is no error message. No hint from Xcode. Absolutely lost.

Finally, this function (with more than 10 parameters) is responsible.

 func animationFrames(level: Float, image: String, frame0: String, frame1: String, frame2: String, frame3: String, frame4: String, frame5: String, frame6: String, frame7: String, frame8: String, frame9: String, frame10: String) { } 

Go crazy! In truth, this is troubling (because there is no syntax error or any type)

0
May 03 '17 at 10:49 pm
source share

I also encountered this problem when installing a new version of Xcode. I solved this by using the following solution:
I opened my project in Xcode all night, this fixed my problem.

0
January 30. '18 at 10:45
source share

For the problem of indexing Xcode 9.3 - Uninstall Xcode and install again from scratch. It works for me.

0
April 5. '18 at 18:18
source share
  • one
  • 2



All Articles