Reputation: 1000
I've a Windows 10 PC running behind ZScaler firewall and which is using a proxy. When I build any project (even basic templates of Android Studio) with Android Studio 3.2.1 I get this error from Gradle (I tried almost everything... without success):
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project 'XXXX'.
Could not resolve all artifacts for configuration ':classpath'. Could not resolve com.android.tools.build:gradle:3.2.1. Required by: project : Could not resolve com.android.tools.build:gradle:3.2.0. Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.0/gradle-3.2.0.pom'. Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.0/gradle-3.2.0.pom'. Connect to dl.google.com:443 [dl.google.com/216.58.205.78] failed: Connection timed out: connect Could not resolve com.android.tools.build:gradle:3.2.0. Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.0/gradle-3.2.0.pom'. Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.0/gradle-3.2.0.pom'. Connect to jcenter.bintray.com:443 [jcenter.bintray.com/5.153.35.248] failed: Connection timed out: connect
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 42s
Upvotes: 0
Views: 1886
Reputation: 1267
Your Android studio need to be connected to the internet. It needs some resource to be downloaded. Connect your pc with internet then build again.
Upvotes: 0
Reputation: 3243
Connect to dl.google.com:443 [dl.google.com/216.58.205.78] failed
As you already mentioned your firewall, you should make sure, that you can reach all required servers.
Beside that, I am a bit confused about gradle 3.20
while your build tools are 3.2.1
which points to the latest android studio version.
Please make sure, that all your versions are set correctly.
1) your build.gradle
(project level, not in the app folder)
your build script in the file should look somehow like this:
google()
repository on position 1
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
2) your gradle-wrapper.properties
file, located in the gradle\wrapper
directory of your project should point to version 4.6
, which is current for studio 3.2.1
#Sun Apr 29 08:09:29 CEST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
Upvotes: 1