Viewing Android dependency tree using gradle

the command

has been used to view the android dependency tree until now

./gradlew: app: dependencies

or operate

directly in the gradle shortcut command on the right

although this command does the job, it prints out all the dependency trees under every step gradle executes, including debugApk, debugCompile, releaseApk, releaseCompile, compile, etc. It takes a long time, but the final result set is also a large one, not to be looked at.

, but we actually only need the dependency tree from the compile time, so we can configure a parameter after the command.


./gradlew :app:dependencies –configuration compile

where the compile configuration compile says you only need to print out the dependencies in the compile environment

it is important to note that when the same stock is in multiple versions, gradle will automatically use the highest version of the library applied everywhere. The library with “(*)” in the figure above indicates that the library has been overwritten.

Read More: