Failed to sync gradle project (Unknown host 'services.gradle.org')

…衆ロ難τιáo~ 提交于 2019-12-08 09:43:43

问题


I have an error with Gradle, when I create a new project in android studio, I'm not experienced in android programming please help me,

see the http proxy error


回答1:


I had the same problem and i tried the above solution (by Sathish Kumar J) but it didnt work.

if found the solution below at this link. http://vjscrazzy.blogspot.co.il/2016/02/failed-to-sync-gradle-project.html

step 1

file>Setttings>appearance and behaviour>system setttings>HTTP proxy> set No Proxy

step 2

build,execution and deployment> Build tools > gradle>now under project level settings > select local gradle distribution>gradle home = F:/Program Files/Android/Android Studio/gradle/gradle-2.4

NOTE:
in my case my default android studio .gradle folder is located in "F:/Program Files/Android/Android Studio/gradle/gradle-2.4" change it with your defualt directory.




回答2:


Try this,

Go to..

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

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




回答3:


In case you're not behind a proxy and still getting this error: Gradle also has global settings - either there are some presets or you saved some proxy settings in the global gradle.properties file. Simply adjust the proxy settings in the global gradle.properties file to your needs. I simply removed the entries in that file since i'm usually not behind a proxy. Good luck.



来源:https://stackoverflow.com/questions/37275654/failed-to-sync-gradle-project-unknown-host-services-gradle-org

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!