Xcode Indexing Stuck or Taking Forever
Quick answer
Indexing hangs when the index store is corrupted or SourceKit loops on a heavy file. Quit Xcode, delete the project's DerivedData, and restart SourceKit.
Most likely fix: Restart SourceKit
How to fix it
Try these in order — the most common fix is first.
1. Restart SourceKit
- In Terminal run: killall SourceKitService
- Xcode restarts the service automatically
Did this fix it?2. Delete DerivedData for the project
- Quit Xcode completely
- Xcode's Settings > Locations shows the DerivedData path; delete your project's folder (or run rm -rf ~/Library/Developer/Xcode/DerivedData/<ProjectName>-*)
- Reopen the project and wait for one fresh index
Did this fix it?3. Reduce what gets indexed
- Remove unused Swift packages and targets
- Split very large files
- Move heavy Swift macros out of hot files and check the Issue navigator for slow type-checks
Did this fix it?4. Reset package caches
- File > Packages > Reset Package Caches
- File > Packages > Resolve Package Versions
Did this fix it?5. Update Xcode and free RAM
- Install the latest Xcode point release
- Close other heavy apps; 16 GB RAM is a practical minimum for large projects
Did this fix it?
Symptoms
The status bar shows 'Indexing' for many minutes or forever, typing lags by seconds, and code completion and jump-to-definition stop working.
Why it happens
- Corrupted index in DerivedData
- SourceKit looping on large files, Swift macros or heavy type inference
- Very large project or many Swift packages resolving
- Not enough RAM, so Xcode swaps
- Regression in a specific Xcode release (reported with some libraries on Xcode 26)
This guide also covers
- xcode indexing stuck
- xcode indexing forever
- why does xcode keep indexing
- xcode slow typing indexing
Still not working?
If Xcode keeps failing, you're not alone. See every Xcode problem users report or the alternatives people switch to.
Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.
Talk to usThe same problem in other apps
Other Xcode errors
- Xcode Simulator Not Launching or Won't Boot
- Xcode 'Unable to Install' App Error
- Xcode 'No Profiles Found' Code Signing Error
- Xcode 'Failed to Register Bundle Identifier' Error
- Xcode Doesn't Show My iPhone (Device Not Detected)
- Xcode Taking Too Much Storage (How to Free 50GB+)
- Xcode 'Build Failed' With No Clear Error
- Xcode SwiftUI Preview Not Working or Crashing