Could not find com.android.tools.build.gradle:3.0.0-alpha7

Viewed 53326

I update the gradle plugin to the latest, and i'm getting this error:

Error:Could not find com.android.tools.build.gradle:3.0.0-alpha7:.
Searched in the following locations:
    file:/C:/Users/dmin/Documents/android-studio/gradle/m2repository/com/android/tools/build/gradle/3.0.0-alpha7//3.0.0-alpha7-.pom
    file:/C:/Users/dmin/Documents/android-studio/gradle/m2repository/com/android/tools/build/gradle/3.0.0-alpha7//3.0.0-alpha7-.jar
    https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha7//3.0.0-alpha7-.pom
    https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.0-alpha7//3.0.0-alpha7-.jar
    https://maven.google.com/com/android/tools/build/gradle/3.0.0-alpha7//3.0.0-alpha7-.pom
    https://maven.google.com/com/android/tools/build/gradle/3.0.0-alpha7//3.0.0-alpha7-.jar

Here's my build.gradle

buildscript {
    repositories {
        jcenter()
        maven { url 'https://maven.google.com' }
    }
    dependencies {
        classpath 'com.android.tools.build.gradle:3.0.0-alpha7'
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

Where i'm getting wrong? since i modified my gradle.build according to the question Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci thank you!!

-- Updated the build.gradle according to Mr Tim, but i'm still having the same error

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build.gradle:3.0.0-alpha7'
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
6 Answers

Update gradle plugin : in gradle.properties file add this line distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

then apply ther plugin in build.gradle file :

buildscript {
repositories {
    ...
    // You need to add the following repository to download the
    // new plugin.
    google()
}

dependencies {
    classpath 'com.android.tools.build:gradle:3.0.1'
}

}

the distributionUrl property inside gradle-wrapper.properties should be:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

that works for me

Related