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?
Huh, I've replaced mavenCentral() with jcenter() and now it finds the plugin.
I wonder if this is a bug in the build system.
Make sure your Android Studio version (if you are on alpha or beta build) matches the gradle plugin version. For example, on my machine I had to make sure that my Android Studio 2.0 beta 2 matches the plugin via
classpath 'com.android.tools.build:gradle:2.0.0-beta2'
classpath 'com.android.tools.build:gradle:1.5.0'
works for me
But better to get the last version here
Add multiDexEnabled true
For using gradle 1.4.+
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:
If you want to use the beta version you have to use jcenter and
Here the jcenter full list.
EDIT 03/11/2015
Also the beta plugin 1.5.x is only on jcenter.