Ophy
Ophy

Reputation: 81

Gradle sync failed: Could not find com.android.tools.build:gradle:3.0.1

my Android Studio project does not load this is the problem:

Could not find com.android.tools.build:gradle:3.0.1. Searched in the following locations: https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar

And my build.gradle is:

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'


    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

please help, thank you

Upvotes: 2

Views: 4528

Answers (2)

Cayden Pierce
Cayden Pierce

Reputation: 1

Add both jcenter() and google() in repositories and allprojects->repositories blocks in build.gradle. Mine looks like this:

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'

    }
}

This is very similiar to ashazar's answer. For me instead of replacing jcenter() with google(), I needed both jcenter() and google().

Upvotes: 0

ashazar
ashazar

Reputation: 714

Try replacing jcenter() with google() in repositories and allprojects->repositories blocks in build.gradle

Upvotes: 2

Related Questions