Failed to remove gradle transitive dependency in Android project

I try to remove transitive dependencies from my Android project, and for some reason excludedoes not work when I try to remove a dependency from my specific dependency.

For example, I want to remove support-annotationsfrom my project

if i use

configurations {
    all*.exclude group: 'com.android.support', module:'support-annotations'
}

Dependency gets excluded from the dependency tree. I can see the dependency tree with. / gradlew app: dependenciesenter image description here

But if I use

 compile('com.android.support:support-v4:23.4.0')
            {
                exclude group: 'com.android.support', module:'support-annotations'
            }

Then I still see the dependency in the dependency tree. enter image description here

So my question is why it does not work when I try to remove a dependency on a specific dependency?

Update 1:

- , star (*) ?

2

Fresco Fresco exclude

Fresco enter image description here

, imagepipeline-base Fresco

compile("com.facebook.fresco:fresco:0.9.0")
            {
                exclude group: 'com.facebook.fresco', module: 'imagepipeline-base'
            }

enter image description here

, imagepipeline-base . , Android-.

+4
1

, . , support-annotation, , support-v4 , support-v4 support-annotation.

2

1:

support-annotation , support-v4 .

2:

support-annotation support-v4 support-v4 , support-v4 .

.. , , , .

(*), , . gradle (*).

build.gradle

+4

All Articles