5

I am new to Android development. so the external libraries (aka. dependencies) are defined in build.gradle like

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v13:21.0.0'
    compile 'com.squareup.dagger:dagger:1.2.1'
    compile 'com.google.code.gson:gson:2.1'
    compile 'de.greenrobot:eventbus:2.4.0'
}

Is there an easy way to find out if any of these libraries has got a newer version for update? I noticed that Android Studio reminds new version available for gson but not for other libraries.

I'm from the iOS background, CocoaPods is the tool we use to manage external libraries. Using pod outdated command, it is very easy to figure out which libs have new version for upgrade.

Saikat
  • 14,222
  • 20
  • 104
  • 125
Chris Chen
  • 5,307
  • 4
  • 45
  • 49
  • If you want to *use* most current versions you can put "+" sign like this: `compile 'com.squareup.dagger:dagger:1.+'`, and you will get updates up to 1.9.9 version. Is it what you're asking, you just want to *know* about updates? – AndroidEx May 07 '15 at 23:50
  • Additionally to what @Android777 said above, Gradle automatically checks for new versions and shows warnings while building or editing build.gradle if not using the latest version. – ozbek May 08 '15 at 00:55
  • 1
    @Android777 thanks, but using + causes Android Studio complains "Avoid using + in version numbers:...". and i just want to know about updates – Chris Chen May 08 '15 at 03:48
  • @ozbek thanks, but like I said, Android Studio only warns me about Google's libs for not using the latest version, like gson. Does your Android Studio inform you available updates for all dependencies? – Chris Chen May 08 '15 at 03:51

2 Answers2

6

There is a lint option called "Newer Library Versions Available".

You may need to add this to your build.gradle as well:

android {
    ...

    lintOptions { warning 'NewerVersionAvailable' }
}

Then you can run Analyze > Run Inspection By Name... > Newer Library Versions Available to get a list of outdated dependencies.

tachyonflux
  • 20,103
  • 7
  • 48
  • 67
  • this seems to be the answer, I tried and it worked. one more question, where did you get this info? like the 'NewerVersionAvailable' string, I googled it and could find any decent documentation explaining this. – Chris Chen May 08 '15 at 03:58
  • All the strings can be found with [lint --show](http://tools.android.com/tips/lint-checks). I said "may need to add" because there was a [bug](https://code.google.com/p/android/issues/detail?id=70488), which was supposedly fixed. – tachyonflux May 08 '15 at 15:15
  • I don't see this working on AS 2.1 or AS 2.2RC2. Did this break in the meantime? – Uli Sep 14 '16 at 00:50
0

Bintray has a watching mechanism that notifies you when a new version of a package you're watching is updated.


I am with JFrog, the company behind Bintray and [artifactory], see my profile for details and links.

Community
  • 1
  • 1
JBaruch
  • 22,610
  • 5
  • 62
  • 90