[已解决]Gradle: Received status code 400 from server: Bad Request

小豆苗 1年前 ⋅ 2344 阅读

全部错误是这样的:

Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/x.x.x/gradle-x.x.x.pom'. Received status code 400 from server: Bad Request。

解决办法:

  1. 在C盘找到这个文件C:\Users\***\.gradle\gradle.properties
  2. ## For more details on how to configure your build environment visit
    # http://www.gradle.org/docs/current/userguide/build_environment.html
    #
    # Specifies the JVM arguments used for the daemon process.
    # The setting is particularly useful for tweaking memory settings.
    # Default value: -Xmx1024m -XX:MaxPermSize=256m
    # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
    #
    # When configured, Gradle will run in incubating parallel mode.
    # This option should only be used with decoupled projects. More details, visit
    # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
    # org.gradle.parallel=true
    #Tue May 15 12:14:36 CST 2018
    systemProp.https.proxyPort=80
    systemProp.http.proxyHost=mirrors.neusoft.edu.cn
    systemProp.https.proxyHost=mirrors.neusoft.edu.cn
    systemProp.http.proxyPort=80
  3. 删除或注释掉最后四行的代理就可以了。

全部评论: 0

    我有话说: