Swift Xcode Index Freezing or Slow

Xcode 8.3 Indexing & Building Extremely Slow

Apple knows about this problem, and says that Xcode 9 beta will perform much better. Note that if you don't want to update to Swift 4, you can continue compiling in Swift 3 mode using Xcode 9. The big limitation is that you won't be able to submit your project to the App Store until Xcode 9 goes final.

Also, Xcode 9 contains a new build system. You don't get it by default: you have to turn it on for this project. Choose File > Project Settings and switch the pop-up menu to New Build System (Preview). This is experimental, but it will be the default build system eventually, so it would be interesting to know whether this makes an appreciable difference.

If you don't want to update to Xcode 9 beta, you will just have to do a binary search: comment out all your code and start adding it back, piece by piece, until you find that piece that's causing the trouble.

Xcode swift indexing forever

Solved it: I deleted the most recently added files from the project and the problem disappeared. Then I started to add back the files, one by one until the problem reappeared. So I found the file causing the problem. Then I deleted the most recently added code from that file and again, the problem disappeared.

That way, I found a piece of code which was responsible for that behavior.

Xcode stuck on Indexing

  1. Open your Project Folder.
  2. Find ProjectName.xcodeproj file.
  3. Right-Click Copy and Paste to Safe Place.
  4. Right-Click Show Package Contents.
  5. Find project.xcworkspace file and delete that file.
  6. Reopen Your Project and clean and Rebuild.

If your problem is not solved then replace the file with your backup file.

Xcode indexing takes ages and uses gigabytes of memory

Found it !!

I needed to remove use_frameworks! from my Podfile (make sure you use cocoapods > 1.5.0) and add

install! 'cocoapods', :disable_input_output_paths => true

Source: https://www.ralfebert.de/ios/blog/cocoapods-clean-input-output-files/

Xcode 8.0 Swift 3.0 slow indexing and building

I solved the problem by commenting all files and then removing comments one by one. I found that the problem is still in the array declaration as described here.

I had code like this and project was not indexing:

class {
var first: String!
var second: String!
var third: String!
var fourth: String!
var fifth: String!

func abc() -> [String] {
var array = [first, second, third, fourth, fifth]
}
}

I've changed it to this and indexing started working:

class {
var first: String!
var second: String!
var third: String!
var fourth: String!
var fifth: String!

func abc() -> [String] {
var array = [first]

array.append(second)
array.append(third)
array.append(fourth)
array.append(fifth)
}
}

Xcode 9.2 Compiling So Slow

I had the same issue when I was using the storyboard. You can try some small tweaks that helped me a lot and now its much better.

  1. Try to off the "Automatically Refresh Views" from Editor.
  2. Update your Xcode to the latest one which is much better and also if they don't Have it on the App Store, try getting it from the developer program from the iTunes connect.

hope this helps a little :)



Related Topics



Leave a reply



Submit