Gradle. Detect dependencies problems

69 views Asked by At

How to check all dependencies of my project which I declare and I do not declare. I have strong feeling that it exists dependencies with few different versions. I have tried https://discuss.gradle.org/t/is-there-a-gradle-equivalent-of-mvn-dependency-analyze/7532/13 but it was tedious to test everything one by one.

1

There are 1 answers

0
cooperok On BEST ANSWER

You can see all dependecies for every Gradle task by command

gradle dependencies

or you can see only subproject dependencies

./gradlew :sub-project-name:dependencies

It will print dependencies graph, like this

+--- project :sub-project-name
+--- com.android.support:support-v4:22.1.+ -> 22.1.1
|    \--- com.android.support:support-annotations:22.1.1
+--- com.google.android.gms:play-services-maps:+ -> 7.3.0
|    \--- com.google.android.gms:play-services-base:7.3.0
+--- org.apache.commons:commons-lang3:3.1
+--- com.crashlytics.android:crashlytics:1.+ -> 1.1.13
+--- com.googlecode.json-simple:json-simple:1.1.1                                                                                                              [307/633]
+--- junit:junit:4.12
|    \--- org.hamcrest:hamcrest-core:1.3
\--- org.robolectric:robolectric:3.0-SNAPSHOT
     +--- org.robolectric:robolectric-annotations:3.0-SNAPSHOT
     +--- org.robolectric:robolectric-resources:3.0-SNAPSHOT
     |    +--- org.robolectric:robolectric-utils:3.0-SNAPSHOT
     |    |    +--- org.robolectric:robolectric-annotations:3.0-SNAPSHOT
     |    |    \--- com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:1.0
     |    +--- org.robolectric:robolectric-annotations:3.0-SNAPSHOT
     |    \--- com.ximpleware:vtd-xml:2.11
     +--- org.robolectric:robolectric-utils:3.0-SNAPSHOT (*)
     +--- org.robolectric:shadows-core:3.0-SNAPSHOT
     |    +--- org.robolectric:robolectric-annotations:3.0-SNAPSHOT
     |    +--- org.robolectric:robolectric-utils:3.0-SNAPSHOT (*)
     |    +--- org.robolectric:robolectric-resources:3.0-SNAPSHOT (*)
     |    +--- com.ibm.icu:icu4j:53.1
     |    \--- com.almworks.sqlite4java:sqlite4java:0.282
     +--- org.bouncycastle:bcprov-jdk16:1.46
     +--- org.ow2.asm:asm:5.0.1
     +--- org.ow2.asm:asm-commons:5.0.1
     |    \--- org.ow2.asm:asm-tree:5.0.1
     |         \--- org.ow2.asm:asm:5.0.1
     +--- org.ow2.asm:asm-util:5.0.1
     |    \--- org.ow2.asm:asm-tree:5.0.1 (*)
     +--- org.ow2.asm:asm-analysis:5.0.1
     |    \--- org.ow2.asm:asm-tree:5.0.1 (*)
     +--- com.ximpleware:vtd-xml:2.11
     +--- org.apache.maven:maven-ant-tasks:2.1.3
     \--- org.apache.ant:ant:1.8.0
          \--- org.apache.ant:ant-launcher:1.8.0