Could not resolve all files for configuration ':classpath'. Could not resolve com.android.tools.build:gradle:3.0.1. Required by: project : Could not resolve com.android.tools.build:gradle:3.0.1. Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'. Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'. Connect to dl.google.com:443 [dl.google.com/216.58.221.110] failed: Connection timed out: connect
3
votes
show your gradle file
– Tejas Pandya
Add your gradle to your question
– Gowtham Subramaniam
@TejasPandya The gradle file might contain confidential informations.
– Martin
@Martin obviously you can hide that information from image
– Tejas Pandya
@TejasPandya Yes and I have done so many times. It can be quite time consuming making sure nothing shows up which must not show up.
– Martin
5 Answers
11
votes
If you are using com.android.tools.build:gradle:3.0.1, then use only google() repository https://developer.android.com/studio/releases/gradle-plugin.html
buildscript {
repositories {
google()
jcenter()
}
It worked for me.
3
votes
If you're opening an existing project using Android Studio 3.0
Preview 5 or later, follow the prompts to automatically update your project to the latest version of the Android plugin.
To manually update your project, include the maven repo
and change the plugin version in your project-level build.gradle
file as follows :
Apply this:
buildscript {
repositories {
...
// You need to add the following repository to download the
// new plugin.
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha5'
}
}
2
votes
From version 26.0.0 of support libraries make sure that the repositories section includes a maven section with the "https://maven.google.com" endpoint.
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
For Gradle build tools plugin version 3.0.0, you can use google() repository:
allprojects {
repositories {
jcenter()
google()
}
}
1
votes