Gradle sync failed: Could not run build action using Gradle distribution 'xxxxxx/gradle-2.14.1-all.zip'

96
itvincent
2017.11.25 16:49 字数 92

Android Studio构建时出现下面的错误

Gradle sync failed: Could not run build action using Gradle distribution 'xxxxxx/gradle-2.14.1-all.zip'.

解决方法

  1. 访问https://services.gradle.org/distributions/找到我们所要的版本
  2. 然后在文件上点右键复制链接
  3. 打开我们项目中gradle/wrapper/gradle-wrapper.properties文件
  4. 修改distributionUrl为复制的链接
  5. 重新build项目,会从我们设置的url下载gradle-xxx-all.zip

例如:

#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
日记本
Web note ad 1