In my build.gradle I have:
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.4.+'
    }
}
However I'm getting:
Error:Could not find com.android.tools.build:gradle:1.4.+.
Searched in the following locations:
    file:/C:/AndroidStudio/gradle/m2repository/com/android/tools/build/gradle/1.4.1/gradle-1.4.1.pom
    file:/C:/AndroidStudio/gradle/m2repository/com/android/tools/build/gradle/1.4.1/gradle-1.4.1.jar
    https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.4.1/gradle-1.4.1.pom
    https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.4.1/gradle-1.4.1.jar
Required by:
    :xxx:unspecified
What to do?
It happens because the gradle plugin for android 1.4.+ doesn't exist (currently) in central maven.
You can check here the full list of the versions available on Central Maven.
Use the last stable version:
classpath 'com.android.tools.build:gradle:1.3.1'
If you want to use the beta version you have to use jcenter and
buildscript {
    repositories {
        jcenter()    
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.4.0-beta6'
    }
}
Here the jcenter full list.
EDIT 03/11/2015
Also the beta plugin 1.5.x is only on jcenter.
buildscript {
     repositories {
         jcenter()
     }
     dependencies {
         classpath 'com.android.tools.build:gradle:1.5.0-beta1'
     }
}
Huh, I've replaced mavenCentral() with jcenter() and now it finds the plugin.
I wonder if this is a bug in the build system.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With