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

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
    原文作者:itvincent
    原文地址: https://www.jianshu.com/p/55440b80af40
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞