Skip to content

How to use SNAPSHOT versions?

Rolf Smit edited this page Nov 9, 2023 · 1 revision

It may happen that SNAPSHOT builds are published for this plugin. SNAPSHOTS are bleeding edge builds with that often only work with alpha/beta or release candidate version of the Android Gradle Plugin.

A big difference with normal builds is that SNAPSHOT artifacts (builds) are not static. Usually artifacts are cached based on the version, however Maven (and thus Gradle) makes an exception for any version that has the -SNAPSHOT suffix. This means that new code, fixes and features can be put into the same SNAPSHOT build and at one moment you run your code Maven will check if there is a different SNAPSHOT build available (based on hashing I believe) and download this new version.

Unfortunately the Gradle Plugin Portal (where Gradle plugins are usually published) does not allow/support SNAPSHOTS (only static artifacts), and Maven Central (where this plugin is also published) does support them but in a different repository. So in order to use these SNAPSHOT builds, modify your settings.gradle plugin management block to something like this:

pluginManagement {
    repositories {
        // Whatever other repositories you may need
        gradlePluginPortal()
        google() /
        mavenCentral()

        // Maven Central Snapshot repository
        maven {
            url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
        }
    }
}
Clone this wiki locally