Failed to sync gradle project (Unknown host 's

2019-06-09 17:38发布

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

enter image description here

3条回答
老娘就宠你
2楼-- · 2019-06-09 18:14

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楼-- · 2019-06-09 18:14

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.

查看更多
SAY GOODBYE
4楼-- · 2019-06-09 18:16

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.

查看更多
登录 后发表回答