3
votes

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

5
show your gradle fileTejas Pandya
Add your gradle to your questionGowtham Subramaniam
@TejasPandya The gradle file might contain confidential informations.Martin
@Martin obviously you can hide that information from imageTejas 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.

Read Document

allprojects {
repositories {
    jcenter()
    maven {
        url "https://maven.google.com"
    }
  }
}

For Gradle build tools plugin version 3.0.0, you can use google() repository:

Read Document

allprojects {
    repositories {
        jcenter()
        google()
    }
}
1
votes

For anyone currently blocked by this,

1 find the version in maven centeral

2 See the repository link at the bottom where it says "Note: this artifact located at ....

in your build script repositories, create a build script repository entry using the link from maven central as below

   maven {
        url 'http://repo.spring.io/libs-milestone/'

    }
1
votes

simple, if you got this issue you need to change add/change google() above on jcenter(). like that:

allprojects {
    repositories {
        //you need to change add/change google() above on jcenter()
        google()
        jcenter()
    }
}

try it, i think its help to solve your problem..