在Android Studio内部构建失败(命令行工作) [英] Build fails inside Android studio (command line works)

查看:132
本文介绍了在Android Studio内部构建失败(命令行工作)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我得到的错误是:

  org.gradle.tooling.GradleConnectionException:无法使用Gradle分发执行构建'http://services.gradle.org/distributions/gradle-1.7-bin.zip'.:无法执行构建使用Gradle发行版'http://services.gradle.org/distributions/gradle-1.7-bin.zip'。 

如果执行 gradlew compileDebug b
$ b

我之前有过这个错误,当时它在重新启动Android Studio后工作,但没有更多。



我试着按照这里的建议设置GRADLE_HOME Gradle home 并使用本地分布。我也尝试删除C:\ Users \XXX文件夹中的.gradle缓存,如其他页面中的建议以及Android Studio中的Invalidate caches / Restart。



它昨天工作,我没有更改构建文件或添加任何新文件。



什么可能是错误的?请帮忙! 解决方案

也许这是同一个问题: https://stackoverflow.com/a/18869864/626354



它需要对build.gradle进行一些修改


I've got a problem building inside Android Studio.

Error I get is:

org.gradle.tooling.GradleConnectionException: Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.7-bin.zip'.: Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.7-bin.zip'.

It works just fine to build if I execute gradlew compileDebug from command line but not inside Android Studio.

I've got this error once before, at that time it worked after restarting Android Studio, but not any more.

I've tried to set GRADLE_HOME as suggested here Gradle home and using a local distribution. I've also tried to remove the .gradle cache in C:\Users\XXX folder as suggested at other pages and "Invalidate caches/Restart" inside Android Studio.

It was working yesterday and I haven't changed the build files or added any new files.

What can be wrong? Please help!

解决方案

Maybe this is the same issue: https://stackoverflow.com/a/18869864/626354

It requires a slight amendment to your build.gradle

这篇关于在Android Studio内部构建失败(命令行工作)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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