Android Studio Gradle sync说无法下载gradle-3.1.3.pom

时间:2018-08-09 12:41:01

标签: android android-studio gradle android-gradle build.gradle

解决以下错误几乎浪费了我的一天。无法获得任何线索。

org.gradle.api.UncheckedIOException: Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom'. Received status code 500 from server: Internal Server Error

我正在gradle-wrapper.properties中使用distributionUrl = https://services.gradle.org/distributions/gradle-4.1-all.zip

我可以手动在同一网络上下载此文件,但是在Andriod Studio中,我遇到了以上错误,并且同步失败。

我的顶级构建文件

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {       
        google()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:3.1.3"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
    }
}

任何帮助都得到感谢

1 个答案:

答案 0 :(得分:0)

打开“ gradle.properties”,然后从中删除代理设置行。再次构建项目。