1
votes

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

4
What is your Error.? Please Explain more Details - BADSHAH
@BADSHAH this message every time generate when i'm upgrade it. - Kaushal Panchal
Please Give me a Project-level build.gradle Screen Short - BADSHAH

4 Answers

1
votes

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.

0
votes

Try this in Android Studio

Settings -> Build -> Gradle -> Android Studio -> Enable embedded maven repository
0
votes

In app level gradle file, add following

repositories {
        google()
        jcenter()
}
0
votes

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.