Sarvesh Thiruppathi
Sarvesh Thiruppathi

Reputation: 275

How to Solve this Gradle error?

I got this error in Gradle Console

Error:A problem occurred configuring root project 'QuakeReport'.

Could not resolve all files for configuration ':classpath'. Could not find com.android.tools.build:gradle:3.0.0. Searched in the following locations: file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar Required by: project :

BUILD FAILED in 41s

I got this error in messages

Error:A problem occurred configuring root project 'QuakeReport'.

Could not resolve all files for configuration ':classpath'. Could not find com.android.tools.build:gradle:3.0.0. Searched in the following locations: file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.jar Required by: project :

Upvotes: 1

Views: 794

Answers (2)

vikas kumar
vikas kumar

Reputation: 11018

try adding this to your project level build.gradle.

  // Top-level build file where you can add configuration options common to all sub-projects/modules.

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

        // NOTE: Do not place your application dependencies here; they belong
    }
}

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

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

Upvotes: 0

Codebender
Codebender

Reputation: 14461

Android artifacts are no longer posted to bintray. Use google's repository to your build script.

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'
    }
}

See here: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#apply_plugin

Upvotes: 0

Related Questions