我已将自定义任务添加到我的build.gradle
文件中以打印出依赖项的依赖项。
// This part is useful for finding conflict resolution(s) between dependencies in order to exclude them.
// You can change the custom value and run following command in terminal:
// ./gradlew passenger-sdk:dependencies --configuration custom
configurations {
custom
}
dependencies {
custom 'com.google.android.gms:play-services-analytics:7.3.0'
}
结果是:
$ ./gradlew passenger-sdk:dependencies --configuration custom
:passenger-sdk:dependencies
------------------------------------------------------------
Project :passenger-sdk
------------------------------------------------------------
custom
\--- com.google.android.gms:play-services-analytics:7.3.0
\--- com.google.android.gms:play-services-base:7.3.0
\--- com.android.support:support-v4:22.0.0
\--- com.android.support:support-annotations:22.0.0
BUILD SUCCESSFUL
Total time: 1.681 secs
我希望排除所有依赖项,因为我拥有它们。我是否应该排除所有三个依赖项play-services-base
和support-v4
以及support-annotations
或仅play-services-base
就足够了?
答案 0 :(得分:0)
排除play-services-base
就足够了。由于您已排除了父依赖关系,因此不会提供support-v4
和support-annotations
,如果没有更多依赖于它。
如果有更多的依赖项,需要support-v4
和support-annotations
用于相同的配置,那么你必须另外排除它们,但它可以为整个配置完成一次。