Swapnil Shukla
Swapnil Shukla

Reputation: 31

Gradle project sync failed in Android Studio 2.3.3

I recently updated my Android Studio from 2.0 to 2.3.3. But when I imported my old projects it started showing Gradle project sync failed. Basic functionality will not work properly.

And messages shows:

Unknown host 'services.gradle.org'. You may need to adjust the proxy setting in Gradle.

How can I solve this?

Upvotes: 3

Views: 17199

Answers (3)

Denn
Denn

Reputation: 823

These instructions apply to a linux system. If the issue came after your recent update, then just point Android Studio to the location of gradle it was using before. to do this, go to

file  -> Settings -> Build, Execution, Deployment Grade

selectGradle . On the Project level settings select Use local gradle distribution and select the folder where gradle was installed. Be sure to select show hidden folders (the very last icon) because the gradle folder is hidden.

If you want this to be a global setting, do the same for the Global Gradle settings. Set the gradle folder there too. Click apply. and you are done!

enter image description here

Upvotes: 0

Adriano Moutinho
Adriano Moutinho

Reputation: 601

Reset all configurations and try again:

Go to..

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

You can also clean project on Build->Clean Project and File->Invalidade Caches/Restart.

If Gradle location is wrong that can also cause this problem. Check on:

File->Setting->Build, Execution, Deployment->Build Tools->Gradle Under Project level Setting find gradle directory.

Grade Directory is usually C:\Users\username.gradle on windows...

Upvotes: 0

Imacoder
Imacoder

Reputation: 581

Probably this is due to broken download of gradle , I too had this problem :
+ Download the latest gradle zip from : https://services.gradle.org/distributions
+ Extract the folder and replace with the folder in android_studio(where you installed it)/gradle/the_existing_gradle_folder
Hope this helps. Thanks !

Upvotes: 4

Related Questions