无法使用Gradle发行版'http://services.gradle.org/distributions/gradle-1.9-all.zip'执行构建 [英] Could not execute build using gradle distribution 'http://services.gradle.org/distributions/gradle-1.9-all.zip'
问题描述
我是android开发的新手,已经下载了Android SDK 4.2并收到错误消息:
I'm new to android development and I've downloaded Android SDK 4.2 and receiving the error:
Could not execute build using Gradle distribution 'http://services.gradle.org /distributions/gradle-1.9-all.zip'. from the event log
我在这里尝试了许多解决方案来解决类似的错误消息:
I have tried many of the solutions here for similar error messages:
文件-无效的缓存/重新启动-无效并重新启动.然后关闭AS并将c/users/myname中的.gradle文件夹重命名为old.gradle并重新启动.
File - Invalidate Caches/restart - Invalidate and Restart. Then shutting down AS and renaming the .gradle folder in c/users/myname to old.gradle and restarting.
在build.gradle中重新命名版本号 com.android.tools.build:gradle:0.7.+'至0.8.+
renaming the version number in build.gradle com.android.tools.build:gradle:0.7.+' to 0.8.+
重命名版本为1.10
renaming version in gradle-wrapper.properties services.gradle.org/distributions/gradle-1.9-all.zip to 1.10
两次卸载AS.
我简单不理解的一些解决方案,对于那些我确实理解的解决方案,似乎我已经尝试了全部.
Some of the solutions I simple don't understand and for those that I do understand it seems I've tried them all.
我读过尝试Gradle 1.9的另一个版本,但不要从头开始.是否有1.9.1、1.9.2等版本?
I read to try another version of gradle 1.9, but don't where to begin. Are there versions like 1.9.1, 1.9.2..etc?
有帮助吗?
build.gradle:
build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
gradle-wrapper.properties:
gradle-wrapper.properties:
#Wed Apr 10 15:27:10 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.9-all.zip
推荐答案
在学习有关Udemy的课程时,我遇到了与顶部所述相同的问题.我可以在Android上运行我的项目,但不能在桌面上运行.经过一番混乱之后,下面是对我有用的解决方案(n.b.我是菜鸟,因此为我的回答简单起见,很抱歉:
I had the same problem as described at the top while following a course on Udemy. I was able to run my project on Android, but not Desktop. After messing around a lot, here is the solution that worked for me (n.b. I am a noob, so apologies for the simplicity of my answer:
具有项目"视图(朝左上方,可以设置为"Android":
with Project view (towards upper left, may be set to "Android":
转到gradle> wrapper> gradle-wrapper.properties,并将gradle分配更改为"gradle-2.10-all.zip
go to gradle>wrapper>gradle-wrapper.properties and change the gradle distribution to "gradle-2.10-all.zip
然后转到build.gradle并将"dependencies {classpath ..."更改为'com.android.tools.build:gradle:2.1.2'"
then go to build.gradle and change "dependencies{classpath..." to "'com.android.tools.build:gradle:2.1.2'"
如果继续出现错误,则可能需要返回到build.gradle并删除:
if you continue to get errors, you may need to return to the build.gradle and delete:
jcenter()
google()
靠近顶部.最后,请通过以下步骤确保使用正确的资产路径:
near the top. Finally, ensure you are using the correct path for your assets by going to:
启动程序选项(在其中选择Android或桌面部署)>编辑配置
Launcher Options(where you select Android or Desktop deployment)>Edit Configurations
在工作目录下,将路径设置为android> assets
under working directory, set the path to android>assets
希望这对您有用
这篇关于无法使用Gradle发行版'http://services.gradle.org/distributions/gradle-1.9-all.zip'执行构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!