If you’re working with Flutter in Android Studio and notice that it keeps endlessly indexing Dart files, you’re not alone. This issue can slow down development, drain system resources, and hinder productivity. The problem typically occurs due to plugin conflicts, corrupted caches, or incompatible versions of Dart and Flutter SDKs.

Common Causes:
- Corrupted Cache Files: Android Studio may endlessly index if its cache is corrupted.
- Plugin Conflicts: Third-party plugins or outdated Flutter plugins may trigger constant indexing.
- Unsupported SDK Versions: Using incompatible versions of Dart or Flutter can cause IDE instability.
- Heavy File Watcher: Having large or deeply nested directories monitored can spike CPU usage and indexing.
How to Fix It:
1. Invalidate Caches and Restart
Go to File > Invalidate Caches / Restart
> Click Invalidate and Restart. This clears the system cache that might be causing the issue.
2. Update Plugins
Make sure your Flutter and Dart plugins are up to date. Go to Preferences > Plugins
and check for updates.
3. Check Dart SDK Path
Ensure your Dart SDK path is correctly set under Preferences > Languages & Frameworks > Dart
.
4. Exclude Unnecessary Directories
Exclude folders like build/
, .dart_tool/
, and node_modules/
by going to File > Project Structure > Modules > Excluded
.
5. Use a Lighter IDE Theme or VM Options
Adjust memory settings in studio.vmoptions
to improve performance. You can increase heap size to help handle large projects better.
6. Disable File Watchers (if unused)
Go to Preferences > File Watchers
and disable any watchers you don’t need.
For advanced Dart performance tips, consider reading this guide from Flutter’s performance documentation.