简体   繁体   中英

Where can I get beta versions of the Android Studio Gradle Plugin?

The new vector assets in Android Studio 1.4 requires the Android Studio Gradle Plugin version 1.4.0-beta3 or later. This page says they are up to 1.5.0-beta1.

But when I enable that in my build.gradle file I get this error:

Error:Could not find com.android.tools.build:gradle:1.4.0-beta6.
Searched in the following locations:
    file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/1.4.0-beta6/gradle-1.4.0-beta6.pom
    file:/C:/Program Files/Android/Android Studio/gradle/m2repository/com/android/tools/build/gradle/1.4.0-beta6/gradle-1.4.0-beta6.jar
    https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.4.0-beta6/gradle-1.4.0-beta6.pom
    https://repo1.maven.org/maven2/com/android/tools/build/gradle/1.4.0-beta6/gradle-1.4.0-beta6.jar
Required by:
    :AndroidBackgroundSync:unspecified

Indeed if you check that URL it only goes up to 1.3.1.

How can I actually use this thing?

The link in the accepted answer is out-of-date. Currently, the Android Gradle plugin is published to the Google Maven repository ( https://maven.google.com ), so you can browse it and find the latest version of the package:

 com.android.tools.build.gradle

The Alpha and Beta versions are listed as well.

UPD: the link to the exact package is: https://maven.google.com/web/index.html#com.android.tools.build:gradle

Link for last beta version for Gradle: link

For beta versions add jcenter() as a repository:

buildscript {
    repositories {
        jcenter()

    }
    dependencies {
           classpath 'com.android.tools.build:gradle:1.5.0-beta1'
    }
}

By the way you can use stable version like this:

classpath 'com.android.tools.build:gradle:1.3.1

In your build.gradle project file put

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.4.0-beta6'
    }
}

then sync project with gradle files or, alternatively, write in the console:

./gradlew clean build

You can check for the last beta version for Gradle here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM