简体   繁体   English

Gradle 更新到 Android Studio 3.2 后构建卡住并且永远不会完成

[英]Gradle build is stuck and never finishes after updating to Android Studio 3.2

I have a project in android and after updating to android studio 3.2 Gradle build is stuck and never finishes.我在 android 中有一个项目,在更新到 android studio 3.2 Gradle 后,构建卡住了,永远不会完成。 I looked at the task manager and the Open JDK Platform Binary task is going to suspended a few seconds after i start the build.我查看了任务管理器,Open JDK Platform Binary 任务将在我开始构建后暂停几秒钟。 Anyone has seen something similar?有人见过类似的东西吗?

  • I have distributionUrl=https://services.gradle.org/distributions/gradle-4.6-all.zip我有 distributionUrl=https://services.gradle.org/distributions/gradle-4.6-all.zip
  • Deleted the.gradle folder and tried again把.gradle文件夹删了再试
  • My build tools version is buildToolsVersion '26.0.2' and version of gradle is 'com.android.tools.build.gradle:3.2.0我的构建工具版本是 buildToolsVersion '26.0.2' gradle 的版本是 'com.android.tools.build.gradle:3.2.0
  • Changed compile to implementation将编译更改为实现

I have no idea why the task is suspended but that is why the build gets stuck when i try from the terminal a Java Platform Binary task is generated and this is not suspended.我不知道为什么任务被挂起,但这就是为什么当我从终端尝试生成 Java 平台二进制任务时构建被卡住并且它没有被挂起。 Any help would be appreciated.任何帮助,将不胜感激。

I managed to solve it by changing the SDK location (File->Project Structure->SDK location) and point to a different path on the JDK location, i had another version of JDK so using that it doesn't suspend the task of Open JDK Platform Binary.我设法通过更改 SDK 位置(文件-> 项目结构-> SDK 位置)并指向 JDK 位置上的不同路径来解决它,我有另一个版本的 JDK,因此使用它不会暂停 Open 的任务JDK 平台二进制文件。 At least this change allows me to sync and build the project.至少此更改允许我同步和构建项目。

I had the same issue and I solved it by downgrading Android Studio to 3.1.4 version.我遇到了同样的问题,我通过将 Android Studio 降级到 3.1.4 版本来解决它。 You can download it from here: https://developer.android.com/studio/archive您可以从这里下载: https : //developer.android.com/studio/archive

You can keep both versions, and you can use the same Android SDK Folder.您可以保留两个版本,并且可以使用相同的 Android SDK 文件夹。 However, I reccommend you to select "Do not import settings" option on the installation process.但是,我建议您在安装过程中选择“不导入设置”选项。 Regards.问候。

Deleting both the "/build/ and "/app/build/" folders solved my problem!删除“/build/”和“/app/build/”文件夹解决了我的问题!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM