如何修复 Android Studio 在执行 Gradle 任务时卡住的问题?

如何修复 Android Studio 在执行 Gradle 任务时卡住的问题?

问题描述:

当我尝试构建/运行项目以及清理它时,Android Studio(测试版)0.8.6 卡住了.它保持响应,但 Gradle: Executing Tasks 消息不会消失(超过 20 分钟是我放弃的时候)并且应用程序永远不会运行.

Android Studio (Beta) 0.8.6 gets stuck when I try to build/run the project, as well as clean it. It stays responsive, but the Gradle: Executing Tasks message doesn't disappear (longer than 20 minutes is when I give up) and the app never runs.

这是我尝试的:

  • 使缓存无效/重新启动

  • Invalidate caches/restart

强制退出并重启

从应用程序中删除它(在 Mac 上)并从官方网站重新下载.

Remove it from Applications (on Mac) and re-download it from the official website.

通过转到 Android Studio -> Preferences -> Gradle 修复它> -> 并勾选 Offline work.仍然不知道出了什么问题,但至少现在它可以编译了.

Fixed it by going to Android Studio -> Preferences -> Gradle -> and ticking Offline work. Still have no idea what was wrong, but at least now it compiles.

在新的 Android Studio 版本中,路径是 File -> Other Settings -> Default Settings -> Build-Excecution-Deployment代码> -> Gradle

In new Android Studio Versions the path is File -> Other Settings -> Default Settings -> Build-Excecution-Deployment -> Gradle