Error:Unknown host 'dl.google.com' You may need to adjust the proxy settings in Gradle

前端 未结 13 2029
长情又很酷
长情又很酷 2020-12-06 16:50

I am getting this error in android studio 3.0.

Unknown host \'dl.google.com\' You may need to adjust the proxy settings in Gradle

<
相关标签:
13条回答
  • 2020-12-06 16:54

    please check your gradle wrapper, there are 2 gradle wrapper, one is in library folder, and one is in gradle folder. probably the version of both gradle wrapper is different. i solve my case by make them as a same version..

    0 讨论(0)
  • 2020-12-06 16:55

    In my case, after I config kotlin for project I face this problem.

    After 30 minutes try 'Auto proxy' and learn about proxy with no hope, I see suddenly I see

    repositories {
        mavenCentral()
    }
    

    in the end of my build.gradle. Then I delete it and it working.
    The most interesting is after it working, I put above line to gradle again but it still working. So maybe it is not a root problem, however I think it may bring some luck in some case.

    Currently, I use Window and AndroidStudio 3.4.2

    0 讨论(0)
  • 2020-12-06 16:57

    Also, check the internet connection and try again clean and build it's worked for me.

    0 讨论(0)
  • 2020-12-06 17:02

    Restarting emulator worked for me.

    0 讨论(0)
  • 2020-12-06 17:03

    I was also having the same problem. I tried the following and it's working for me:

    Windows

    Go to : File > Settings > Appearance & Behavior > System Settings > HTTP Proxy [Under IDE Settings] Enable following option Auto-detect proxy settings

    Mac

    Go to : Android Studio > Preferences > Appearance & Behavior.. etc

    You can also use the test connection button and check with google.com to see if it works or not.

    0 讨论(0)
  • 2020-12-06 17:03

    I was facing the same error even after trying every possible combination of proxy settings, invalidate cache and restart.

    The error vanished as soon as I switched my internet connection from wifi to mobile hotspot. Strange.

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