我正在尝试从我的 Android 项目中删除传递依赖项,但由于某种原因exclude
,当我尝试从我的特定依赖项中删除依赖项时它不起作用。
例如我想support-annotations
从我的项目中删除
如果我使用
configurations {
all*.exclude group: 'com.android.support', module:'support-annotations'
}
依赖项被排除在依赖关系树之外。我可以使用 ./gradlew app:dependencies 查看依赖树
但如果我使用
compile('com.android.support:support-v4:23.4.0')
{
exclude group: 'com.android.support', module:'support-annotations'
}
所以我的问题是,为什么当我尝试从特定依赖项中删除依赖项时它不起作用?
更新1:
还有谁能告诉我star
树中依赖项旁边的 (*) 符号代表什么?
更新 2
我也在使用Fresco我用 Fresco 尝试了同样的事情,并且exclude
规则似乎适用于它
Fresco的依赖树
imagepipeline-base
当我在 Fresco 中排除时的依赖树
compile("com.facebook.fresco:fresco:0.9.0")
{
exclude group: 'com.facebook.fresco', module: 'imagepipeline-base'
}
如您所见,imagepipeline-base
依赖项被排除在外。所以我不知道为什么这不适用于 Android Support Annotations 传递依赖