I have run gradlew
command to get Gradle dependencies tree:
gradlew.bat app:dependencies
On output I am getting different type of symbols attached with each dependency:
com.twotoasters.servos:util-otto:1.0.0
com.squareup.okhttp:okhttp:2.4.0 (*)
com.android.support:recyclerview-v7:23.2.0 -> 25.0.0
Some dependencies are without any symbol, some are with (*)
and ->
.
What do these symbols mean?
I have tried to search this, but failed to find any help on this.
Dependencies with the same coordinates that can occur multiple times in the graph are omitted and indicated by an asterisk(*).
In Gradle dependencies are libraries required to build your code. Each of these libraries may have their own dependencies, adding transitive dependencies to your project. This structure is called the Gradle dependency tree, with its own rules on dependency conflict resolution and more.
Sadly, the Gradle docs do not cover this topic so it is a bit confusing. Issuing gradlew dependencies | tail shows a legend explaining the meaning of the printed suffixes. (c) - dependency constraint (*) - dependencies omitted (listed previously) (n) - Not resolved (configuration is not meant to be resolved)
(*)
stands next to the dependency, which has already been imported though other artifact, thus resulting in duplication.
At the end of the output of ./gradlew :app:dependencies
you can see this:
->
stands next to the dependency, which has already been imported through other artifact, but with a newer version. Gradle will prefer the newer version.
Hence, com.android.support:recyclerview-v7:23.2.0 -> 25.0.0
would mean, that 25.0.0
version is already imported, but particularly that artifact is dependent on an older 23.2.0
version.
See explanation by Egor Andreevici from his "Making the most of your Gradle Builds" talk from Droidcon Italy 2017.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With