Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of asterisk and arrow symbols in Gradle dependencies tree

Tags:

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.

like image 567
dev90 Avatar asked Apr 27 '17 11:04

dev90


People also ask

What does * mean in Gradle dependency tree?

Dependencies with the same coordinates that can occur multiple times in the graph are omitted and indicated by an asterisk(*).

How do you read a Gradle dependency tree?

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.

What does C mean in Gradle dependency tree?

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)


1 Answers

(*) 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:enter image description here

-> 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.

like image 178
azizbekian Avatar answered Sep 23 '22 08:09

azizbekian