Experiencing freezes in Android Studio when running Dart code can be frustrating, especially for Flutter developers. This issue typically arises due to a combination of IDE misconfigurations, outdated plugins, or performance bottlenecks in the Dart analysis server.

To begin resolving the problem, try clearing the cache by navigating to File > Invalidate Caches / Restart, then restarting Android Studio. Also, ensure your Dart and Flutter plugins are up-to-date via Settings > Plugins. Another key factor is memory allocation — increase heap size in studio.vmoptions to give Android Studio more resources, particularly if you’re working with large projects.
You may also experience this freeze when running an emulator or device with heavy processes. Disabling code analysis temporarily or excluding certain directories from indexing might help. If the problem persists, consider switching to Android Studio Giraffe or newer, which reportedly offers improved performance for Dart and Flutter projects.
For a more detailed breakdown and community-driven solutions, check out this helpful discussion on Stack Overflow.