Gradle Sync Failed Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom'

前端 未结 5 738
野性不改
野性不改 2020-12-31 22:28

I am unable to build a project in Android Studio and I am receiving the following errors.

  1. Gradle Sync Failed.
  2. Could not GET \'https://dl.google.com/dl
相关标签:
5条回答
  • 2020-12-31 22:58

    In addition to @mhaseebn answer I have deleted proxy entries in C:\Users<account_name>.gradle\gradle.properties of windows machine worked for me

    0 讨论(0)
  • 2020-12-31 23:05

    i had the same problem on mac, remove http proxy setting from .gradle file in user directory

    0 讨论(0)
  • 2020-12-31 23:10

    For me, all I had to do was go to C:\Users<account_name>.gradle\gradle.properties in Windows Explorer and replace the file contents with:

    ## 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
    systemProp.http.nonProxyHosts=
    systemProp.http.proxyHost=
    systemProp.http.proxyPassword=
    systemProp.http.proxyPort=80
    systemProp.http.proxyUser=
    systemProp.https.nonProxyHosts=
    systemProp.https.proxyHost=
    systemProp.https.proxyPassword=
    systemProp.https.proxyPort=80
    systemProp.https.proxyUser=
    

    Then sync my gradle and accept settings and all started working well.

    0 讨论(0)
  • 2020-12-31 23:10

    go to file>settings and find http proxy click on manual proxy configuration and select http

    • host name: fodev.org
    • port : 8118
    0 讨论(0)
  • 2020-12-31 23:11

    I found the solution.

    • The problem was I set proxy details of my University proxy server for internet access in Android Studio. When this problem appeared I tried build the project with proxy on internet connection with proxy but it did not work.
    • Then I removed the proxy from Android Studio preferences and connected to non-proxy internet connection but the problem did not disappear.
    • Then I Googled a lot and came here but could not find the root cause.
    • I updated AS from 3.1.3 to 3.2 but the problem still persisted.
    • Finally, I started looking for hidden proxy server details in AS and found them in gradle.properties file located Gradle -> Resource Bundle 'gradle' -> gradle.properties.
    • Deleted the proxy server details in this file and ran the build with successful completion after performing some packages update on the suggestions Android Studio.

    Bingo!

    0 讨论(0)
提交回复
热议问题