12

I have a project with 3 sub-projects. I want the 3 sub-projects to use the same dependencies versions so I factored all the versions in the root build.gradle:

allprojects {
ext.versions = [
        supportLibVersion: '26.1.0',
        playServicesVersion: '11.2.2',
        retrofitVersion: '2.1.0',
        retrofitConverterGsonVersion: '2.1.0',
        retrofitRxjava2AdapterVersion: '1.0.0',
        rxjava2Version: '2.0.5',
        rxandroidVersion: '2.0.1',
        timberVersion: '4.5.1',
        ...
]
}

Now lint doesn't highlight new libraries available anymore. It somehow still works for the supportLibs but not for the other ones.

Any chance I can have this working again?

mbonnin
  • 6,893
  • 3
  • 39
  • 55

3 Answers3

5

This is not an exact answer to the question. I had the same concerns some time ago (had declared global vars and referred to them from build.gradle files).

I've found gradle-versions-plugin library, which resolved my concerns.

It will prompt with detailed info after ./gradlew dependencyUpdates

enter image description here

azizbekian
  • 60,783
  • 13
  • 169
  • 249
  • Nice, it looks like it also finds more upgrades than lint too. Thanks. – mbonnin Sep 19 '17 at 09:16
  • Also, it looks like it works with android gradle plugin 3.0.0-beta6 – mbonnin Sep 19 '17 at 09:23
  • 1
    @mbonnin, yep it does, I forgot to add `google()` as a repository source. Updating the answer. – azizbekian Sep 19 '17 at 09:26
  • With Gradle `4.6` and Gradle plugin `3.2.1` I'm getting error `Resolving configuration 'androidTestAnnotationProcessorCopy' directly is not allowed`. Do you have any idea how to fix that? – Micer Nov 03 '18 at 21:35
0

In Android Studio, go to the Analyze menu and choose Run Inspection by Name -> Newer Library Versions Available. Choose Whole Project and wait for your results.

Westy92
  • 19,087
  • 4
  • 72
  • 54
-1

The easiest way I have found (AS 3.6.3) is to open the project structure with Ctrl+Alt+Shift+S where there is a Suggestions tab:

enter image description here

Daniel Wilson
  • 18,838
  • 12
  • 85
  • 135