I am working with SNAPSHOT versions of some libraries in Android Studio.
The problem is that Gradle seems to use a cached version of these libraries and doesn't redownload the new updated snapshot version.
I tried to use something like this in my gradle script, but it doens't work.
dependencies {
compile ('myGroupId:myArtifactId:X.Y.Z-SNAPSHOT'){
changing=true
}
}
The only workaround that seems to work is to delete the ~/.gradle/caches
directory and then resync the project in Android Studio.
Of course it is not a good solution.
How can we work with snapshot versions?
You can also use the gradle parameter --refresh-dependencies
The --refresh-dependencies option tells Gradle to ignore all cached entries for resolved modules and artifacts. A fresh resolve will be performed against all configured repositories, with dynamic versions recalculated, modules refreshed, and artifacts downloaded. ...
I for myself created a new gradle run command called refresh which calls ./gradlew --refresh-dependencies clean
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