看到依赖树
使用任务依赖项。根据模块的设置方式,可能是 ./gradlew dependencies
或者看模块应用的依赖关系使用 ./gradlew :app:dependencies
build.gradle 文件之后的示例
dependencies {
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.google.android.gms:play-services:6.5.87'
}
将生成以下图表:
Parallel execution is an incubating feature.
:app:dependencies
Project :app. . .
_releaseApk - ## Internal use, do not manually configure ##
+--- com.android.support:design:23.2.1
| +--- com.android.support:support-v4:23.2.1
| | \--- com.android.support:support-annotations:23.2.1
| +--- com.android.support:appcompat-v7:23.2.1
| | +--- com.android.support:support-v4:23.2.1 (*)
| | +--- com.android.support:animated-vector-drawable:23.2.1
| | | \--- com.android.support:support-vector-drawable:23.2.1
| | | \--- com.android.support:support-v4:23.2.1 (*)
| | \--- com.android.support:support-vector-drawable:23.2.1 (*)
| \--- com.android.support:recyclerview-v7:23.2.1
| +--- com.android.support:support-v4:23.2.1 (*)
| \--- com.android.support:support-annotations:23.2.1
+--- com.android.support:cardview-v7:23.1.1
\--- com.google.android.gms:play-services:6.5.87
\--- com.android.support:support-v4:21.0.0 -> 23.2.1 (*)
. . .
在这里你可以看到该项目直接包括 com.android.support:design
版本 23.2.1,它本身带来了版本 23.2.1 的 com.android.support:support-v4
。但是,com.google.android.gms:play-services
本身依赖于相同的 support-v4
,但旧版本为 21.0.0,这是 gradle 检测到的冲突。
当 gradle 跳过子树时使用 (*)
,因为之前已经列出了这些依赖项。