You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android模拟器无法联网求助:Flutter开发环境下的突发故障排查

Troubleshooting Your Flutter App Run Issue (IntelliJ + Pixel 2 API 28)

Hey there! It’s super frustrating when a project that was working perfectly suddenly breaks without obvious changes—let’s walk through the most likely fixes step by step:

1. Fix Simulator-Specific Glitches

Android emulators can get into wonky states after running for a while, even if you haven’t touched network settings. Try these:

  • Restart the emulator directly using the toolbar’s restart button (the circular arrow icon).
  • If restarting doesn’t work, wipe the emulator’s data: Open the emulator’s Settings → System → Reset → Erase all data, then reboot and re-run your app.

2. Refresh Flutter/Dart Dependencies & Caches

Corrupted local caches are a common culprit, even with stable internet:

  • In IntelliJ’s terminal, run flutter clean to clear old build artifacts.
  • Next, run flutter pub get to re-fetch all dependencies.
  • If that still fails, manually delete the .dart_tool and build folders in your project root, then re-run flutter pub get.

3. Reset IntelliJ IDE Caches & Check Plugins

IDE caches can get stale and cause unexpected issues:

  • Go to File → Invalidate Caches..., select "Invalidate and Restart" to clear IntelliJ’s cached data.
  • Verify your Flutter plugin is up to date: Go to Settings → Plugins, search for "Flutter", and check if an update is available. Outdated plugins can clash with your Flutter SDK version (even if you didn’t intentionally update it!).

4. Confirm Flutter SDK Version

Sometimes IDEs can auto-switch SDK versions without you noticing:

  • Run flutter --version in the terminal to check your current SDK version. Compare it to the version you were using two days ago (if you remember it).
  • If the version changed, switch back via Settings → Languages & Frameworks → Flutter by selecting the correct SDK path.

5. Reset Android Gradle Files

Corrupted Gradle files can block app builds:

  • Delete the .gradle folder inside your project’s android directory.
  • Re-run flutter run—this will force Gradle to re-generate all necessary configuration files from scratch.

内容的提问来源于stack exchange,提问作者Prasath S

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 15:32:46