使用 64 位或 32 位版本的 Android Studio 时,Gradle 卡在“build"或“assembleDebug" [英] Gradle gets stuck at either 'build' or 'assembleDebug' when using the 64bit or 32bit version of Android Studio

查看:41
本文介绍了使用 64 位或 32 位版本的 Android Studio 时,Gradle 卡在“build"或“assembleDebug"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去几个月我遇到的问题是 Android Studio 经常会卡在 Gradle: build,如此处.Android Studio 本身会保持响应,但构建根本不会进展.它也永远不会产生任何类型的错误,所以我不能真正发布任何有用的信息.一旦进入蓝月亮,它可能会突然起作用,但没有什么可靠的.

The issue I've had over the past few months is that Android Studio would often get stuck on Gradle: build, as seen here. Android Studio itself would stay responsive but the build simply wouldn't progress. It also never generates any kind of error, so I can't really post any useful information. Once in a blue moon it might suddenly work, but nothing reliable.

最近我在 Stack Overflow 上发现了一篇帖子,其中有人的 Android Studio 在尝试创建新项目时会卡在 Gradle: build 上,并且他注意到这个问题在32 位版本的 Android.所以我想,为什么不试试呢.事实证明,构建不再是问题,但是 assembleDebug 在尝试构建应用程序时是.正如在此处所见.

Recently I found a post here on Stack Overflow where someone's Android Studio would get stuck on Gradle: build when he tried to create a new project, and he noticed that this issue didn't exist in the 32-bit version of Android. So I thought, why not try that. Turns out that building isn't an issue anymore, but assembleDebug is, when trying to build the application. As can be seen here.

当然,当使用命令提示符和 gradlew 运行时,所有这些命令都可以完美运行.

Of course all these commands work flawlessly when run using command prompt and gradlew.

到目前为止我尝试过的:

What I've tried so far:

  • 重新安装 Android Studio(包括删除 .AndroidStudioProject)
  • 将 Android Studio 升级到最新版本
  • 从项目中删除任何构建文件
  • 在 Android Studio 中创建全新的项目
  • 从 64 位 Android Studio 切换到 32 位 Android Studio

我正在运行最新版本的 Android Studio,使用版本 19.1.0 的构建工具、gradle v0.11+ 和 Windows 8.1.

I'm running the latest version of Android Studio, using version 19.1.0 of the build tools, gradle v0.11+ and am on Windows 8.1.

还有什么我可以尝试的吗?这开始变得非常烦人.我能想出的最后一个可能的解决方案是执行完整的格式和全新的 Windows 安装.

Is there anything else I can try? This is starting to become seriously annoying. The last possible solution I can come up with is just doing a complete format and a fresh Windows installation.

推荐答案

因为这个问题没有答案我就分享一下,我做了什么,来解决这个问题.从我所看到的情况来看,问题在于 maven 存储库中存在无法加载的依赖项(或许多依赖项).因此,您必须一一获取所有依赖项并检查 Maven 存储库中是否存在.

Because there is no answer to this problem I will share, what I have done, to solve this issue. From what I have seen, the problem is that there is a dependancy(or many) from a maven repo that can not be loaded. So you have to take all dependacy one by one and check if exist on the maven repo.

例如,我依赖于来自http://JRAF.org/static/maven/2",当时无法打开.

For example I was having a dependancy for "org.jraf:android-switch-backport:1.3.1" from "http://JRAF.org/static/maven/2" that at that time could not be opened.

我的 build.gradle 看起来像这样:

My build.gradle looked like this:

  repositories {
      mavenCentral()
      maven {
        url "http://JRAF.org/static/maven/2"
      }
  }

  compile "org.jraf:android-switch-backport:1.3.1

这篇关于使用 64 位或 32 位版本的 Android Studio 时,Gradle 卡在“build"或“assembleDebug"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆