Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't update to Android Studio gradle 1.4 plugin

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?

like image 367
Alexander Kulyakhtin Avatar asked Sep 18 '15 18:09

Alexander Kulyakhtin


2 Answers

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'
     }
}
like image 194
Gabriele Mariotti Avatar answered Oct 08 '22 19:10

Gabriele Mariotti


Huh, I've replaced mavenCentral() with jcenter() and now it finds the plugin.

I wonder if this is a bug in the build system.

like image 26
Alexander Kulyakhtin Avatar answered Oct 08 '22 19:10

Alexander Kulyakhtin