I'm trying to run Android Studio on windows 10. Currently I have the most up to date version of Android Studio. Every time I try to open a new project or open an existing project, the gradle fails to build always displaying connection reset error message. This is the error message it displays.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:4.1.2.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:4.1.2.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.2/gradle-4.1.2.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.2/gradle-4.1.2.pom'.
> Connection reset
> Could not resolve com.android.tools.build:gradle:4.1.2.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.2/gradle-4.1.2.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.2/gradle-4.1.2.pom'.
> Connection reset
I currently have the file gradle.build set up like this because this is how comes automatically for me
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.2"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And I have the gradle-wrapper.properties file set up like this
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip
I have tried changing the line
distributionUrl=https://services.gradle.org/distributions/gradle-6.5-bin.zip
to
distributionUrl=https://services.gradle.org/distributions/gradle-6.5-all.zip
but that didn't change anything. I tried seeing if it was an Internet connection problem and nothing changed. I'm not sure what else there is to try.
question from:
https://stackoverflow.com/questions/65838549/android-studio-could-not-resolve-all-artifacts-for-configuration-classpath 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…