Resolving Flutter Clean Hang on macOS | Generated by AI
Ah, I see what you mean 👍
Sometimes flutter clean can appear to “hang” on macOS — especially if there are a lot of generated files, or if Xcode’s DerivedData folders are huge.
✅ Try These Steps
-
Cancel the stuck command Hit
CTRL + C. - Clean manually (same effect as
flutter clean)
You can delete these build/cache folders yourself:rm -rf build/ .dart_tool/ ios/Pods ios/Podfile.lock ios/Flutter/Flutter.framework ios/Flutter/Flutter.podspecIf you also want Xcode’s cache gone:
rm -rf ~/Library/Developer/Xcode/DerivedData - Re-get dependencies
flutter pub get - Reinstall CocoaPods (for iOS)
cd ios pod install --repo-update cd .. - Build/run again
flutter run
⚡ Tip: The first time after cleaning may take a little longer (since Flutter needs to regenerate .dart_tool, .pub-cache, iOS Pods, etc.), but it should not stay frozen forever. If you keep seeing it “stuck”, it might be related to:
- Outdated Flutter SDK → Run
flutter upgrade - Outdated CocoaPods → Run
sudo gem install cocoapods - Rosetta / M1 chip issues: If you’re on Apple Silicon, sometimes you need to run
arch -x86_64 pod installinside theiosfolder, depending on your setup.
👉 Do you want me to give you a one-liner script that wipes build caches and resets Pods (basically a “super clean”) so you don’t have to debug flutter clean being stuck?