Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio: Snapshot Dependencies Don't Update properly

I'm working With Android Studio 8.9

I've got a build.gradle with the following dependency defined:

compile ('my.program.commons:my-program-commons:0.0.2-SNAPSHOT@jar')

This dependency is stored in a private Sonatype nexus repository.

When I make changes in the my.program.commons code, I upload to nexus.

The problem is that when I then try to compile against the new SNAPSHOT android studio will fail to pick up changes.

When run from the command line gradle will build succesfully - but Android Studio will not recognize the new files.

If i do a version tick - say from 0.0.2-SNAPSHOT to 0.0.3-SNAPSHOT Android Studio will understand the new version and download and everything works out fine.

I don't want to have to do a minor version tick on every single change.

like image 827
Nathaniel D. Waggoner Avatar asked Oct 28 '14 14:10

Nathaniel D. Waggoner


People also ask

Can I delete Gradle caches?

To clear your gradle cache in android studio: open terminal and. run gradlew clean. conclusions: caching of all normal Android builder tasks is handled by Gradle.

Where is dependencies file in Android Studio?

Go to File > Project structure in Android Studio. Select the app module in the Modules list on the left. Select the Dependencies tab.


1 Answers

You need to configure the cache duration, by default gradle won't look for updates for 24 hours:

http://www.gradle.org/docs/current/userguide/dependency_management.html#sec:controlling_caching

like image 64
rseddon Avatar answered Oct 27 '22 19:10

rseddon