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

Android Studio断电崩溃重启后Clean Project等选项禁用求解决方案

Fixes for Disabled Clean/Run/Debug Features After Android Studio Crash (Power Outage)

Hey, I’ve dealt with this exact headache after a sudden power cut—nothing’s more annoying than having Android Studio’s core features locked up like that. Let’s walk through the tried-and-tested fixes that got my setup back to normal:

1. Invalidate Caches & Restart (First Go-To Fix)

This is the most common fix for weird AS glitches caused by corrupted cache files from the crash:

  • Open Android Studio, go to File > Invalidate Caches...
  • Check the box next to "Invalidate and Restart"
  • Let AS fully restart and rebuild its cache files. This might take a minute, but it fixes most minor corruption issues.

2. Delete Corrupted Project Configuration Folders

Power outages often mess up the hidden config folders in your project. Here’s how to reset them:

  • Close Android Studio completely
  • Navigate to your project’s root directory
  • Delete the .idea folder and all .gradle folders (both the one in the project root and any inside module folders)
  • Reopen Android Studio—it’ll automatically regenerate these config files from scratch.

3. Force a Gradle Sync

Sometimes the sync state gets stuck, which disables run/clean features:

  • Open your project in AS
  • Look for the "Sync Project with Gradle Files" button (it looks like a refresh icon in the top-right toolbar)
  • Click it and wait for the sync to finish. If there are errors (like missing dependencies), check the Build tab for details and fix them first.

4. Check for Corrupted Build Files

If the power cut happened while AS was writing to build.gradle files, they might be incomplete:

  • Open your project’s root build.gradle file and each module’s build.gradle file
  • Look for syntax errors, unclosed brackets, or truncated lines (like a dependency that cuts off mid-string)
  • Fix any issues you find, then re-run the Gradle sync.

5. Re-Import the Project

If all else fails, a fresh import can reset broken project bindings:

  • Close Android Studio
  • Make a backup copy of your project folder (just to be safe)
  • Open AS and select "Import Project" from the welcome screen
  • Navigate to your project’s root folder and follow the import wizard to set it up again.

Quick Note

If none of these work, it’s possible the Android Studio installation itself got corrupted. In that case, uninstall AS, delete any leftover config folders (like ~/.AndroidStudioX.X on Linux/macOS or C:\Users\YourName\.AndroidStudioX.X on Windows), then reinstall the latest version.

内容的提问来源于stack exchange,提问作者Mohammed Nishar

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.19 08:16:50