Reputation: 3208
I have a android library which is on maven central. In my app's build.gradle I have defined dependancy.
compile('com.x:y:2+')
But this is not taking latest version. I have release 2 version, 2.0.1 and 2.0.2 but It's taking 2.0.1 always. Why this is happening. My assumption was that it will always take latest version available.
Upvotes: 0
Views: 46
Reputation: 523
There are two possibilities, which could lead to such a situation. Either mavenCentral is not specified as a repository and gradle uses the newest version of a different maven repository. The other possibility would be that you have a transitive dependency in your build script, which uses the 2.0.1 version. You can learn more about the structure of your dependencies on the cli with the gradle dependencies
command.
As you can see these 'this version and upwards' dependencies are likely cause problems and I would recommend to avoid such.
Upvotes: 1