0

enter image description here

I have successfully published my android library on bintray jcenter. I have a repository which has a package which contains two versions, 0.0.1 and 0.0.2. I want to make the 0.0.2 as the latest and default version.

Whenever my library users use the following script to download my library, I want it to download from the latest version always:

compile 'com.userexperior:userexperior-android:+'

I tried in two sample apps, the above script is picking the old version 0.0.1, though I am able to use the latest version 0.0.2 by manually writing it in the gradle script but not via a "+" sign in the gradle script:

compile 'com.userexperior:userexperior-android:0.0.2'

Can anyone from the bintray support team or community guid me to achieve it.

zeeali
  • 1,524
  • 20
  • 31
  • Just to add, I've seen that you published `0.1.4`, the `.pom` file in jcenter shows it as latest so `com.userexperior:userexperior-android:+` downloads `0.1.4` – Royg Apr 30 '18 at 13:03
  • @Royg sometimes it doesn't pick the latest version always! I added version 0.2.5 today, it is working manually, however + sign is not picking it automatically, it is picking the previous one which is 0.2.4 – zeeali Dec 19 '18 at 09:30
  • works for me! I've been able to download version 0.2.5 (can see the version in the cache). The `maven-metadata.xml` holds the correct current version. – Royg Dec 19 '18 at 09:47
  • It's been almost 2 hours ago, I released a new version 0.2.9 but gradle script with + sign picking the earlier one i.e. 0.2.8. I don't know how much time bintray takes to set the new version as latest. – zeeali Mar 29 '19 at 15:56
  • please read my comment in the answer below about *Declaring a dynamic version* – Royg Mar 29 '19 at 16:04

1 Answers1

1

If you look at the maven-metadata file of your project:

<?xml version="1.0" encoding="UTF-8"?>
<metadata>
  <groupId>com.userexperior</groupId>
  <artifactId>userexperior-android</artifactId>
  <version>0.0.2</version>
  <versioning>
    <latest>0.0.2</latest>
    <release>0.0.2</release>
    <versions>
      <version>0.0.1</version>
      <version>0.0.2</version>
    </versions>
    <lastUpdated>20180423152323</lastUpdated>
  </versioning>
</metadata>

You can see that the latest tag is directing it to version 0.0.2: 0.0.2

Can you check if you are using the right way to resolve latest version? I'm not a gradle expert but it looks like an ANT method for latest...

Ariel
  • 3,406
  • 14
  • 17
  • sometimes bintray-jcenter does not pick the latest version released, it picks the previous one! I have to manually specify the version and then it works! – zeeali Dec 19 '18 at 09:05
  • I added version 0.2.5 today, it is working manually, however + sign is not picking it automatically, it is picking the previous one which is 0.2.4 – zeeali Dec 19 '18 at 09:29
  • The problem you see is related to gradle's **Declaring a dynamic version**, it states in the guide, _Gradle caches dynamic versions of dependencies for 24 hours_, see here: https://docs.gradle.org/current/userguide/declaring_dependencies.html#declaring_a_dependency_without_version – Royg Dec 19 '18 at 09:56