如何检查我声明的项目的所有依赖项,我没有声明。我有强烈的感觉,它存在几个不同版本的依赖。 我尝试了https://discuss.gradle.org/t/is-there-a-gradle-equivalent-of-mvn-dependency-analyze/7532/13但是逐一测试所有内容是很乏味的。
答案 0 :(得分:2)
您可以通过命令
查看每个Gradle任务的所有依赖项gradle依赖
或者您只能看到子项目依赖项
./ gradlew:sub-project-name:dependencies
它会打印依赖关系图,就像这样
+--- 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