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

标签 android android-studio gradle android-gradle-plugin 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()
    }
}

任何帮助

最佳答案

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

关于android - Android Studio Gradle sync说无法下载gradle-3.1.3.pom,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51767337/

相关文章:

android - ToggleButton 更改方向时的状态已更改

Android Studio,工具提示消失得如此之快

android - 我在尝试运行 Android 虚拟设备时收到错误列表

android - 没有这样的文件或目录,无法构建Android项目

gradle - 在 build.gradle 中找不到方法 kaptKotlin

java - 不同组的不同子布局 ExpandableListView

android - OpenGL 3.0 ES 中的错误纹理渲染

java - 在 android 上可跨 textView

android-studio - Flutter SDK 在哪里? [Ubuntu]

gradle 中的 javadoc 任务 - 链接到 Oracle 的 javadoc,而不是到处显示未链接的限定类名