1

Upgrade Gradle build tools to the latest version then this issue occurs. Could not resolve all artifacts for configuration ': classpath'.

Could not resolve com.android.tools.build:gradle:3.5.1. Required by: project : Could not resolve com.android.tools.build:gradle:3.5.1. Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.1/gradle-3.5.1.pom'. Could not HEAD 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.1/gradle-3.5.1.pom'. Remote host closed connection during handshake

Kaushal Panchal
  • 1,785
  • 1
  • 11
  • 27

4 Answers4

1

Here is the possible reason,

1) Check your internet connection, if it works then,

2) Check that your firewall, because if some of the Google Service blocks at that time also you get an exception.

3) Invalid cache and restart Android Studio.

Hops this helps.

Chandan Sharma
  • 2,803
  • 1
  • 17
  • 25
  • Thanks, It's really helping me. My service provider blocks some website so this issue happen. – Kaushal Panchal Nov 25 '19 at 04:16
  • After updating AndroidStudio 3.5.3. Project is not building,Could you please help me on this, My Question -- https://stackoverflow.com/questions/60221000/org-gradle-internal-exceptions-locationawareexception-org-gradle-api-projectco – Naveen Feb 18 '20 at 06:13
0

Try this in Android Studio

Settings -> Build -> Gradle -> Android Studio -> Enable embedded maven repository
Dinesh
  • 948
  • 6
  • 11
0

In app level gradle file, add following

repositories {
        google()
        jcenter()
}
Mehul Pamale
  • 349
  • 3
  • 13
0

I was able to solved this error in our school where we used network "proxy" settings. The error is always [Could not resolve all artifacts for configuration ':classpath'.] from old version of Android Studio SDK even the new one 3.6.1. Below are the steps I made and hope it will be of great help to you guys: 1. Check your Network Settings -> Proxy -> Use a Proxy Server (TURN IT OFF) 2. Check Control Panel\Network and Internet\Network Connections -> Ethernet Properties -> IPV4 Properties -> Change to obtained (or you set it with your common network IP) 3. Open the file gradle.properties location C:\Users\.gradle\ and remove all the settings related to "proxy" which makes the Android error in classpath. Thats it.