There is a lot of discussion about this. Some say if I have appcompat-v7 I do not need support-v4 since appcompat-v7 already has all the classes of support-v4. Also, that support-design already has all the classes from appcompat-v7 hence we do not even need that. There are some answer that are many years old so things might have changed by now. I did a test, in my project I have support-design, support-v4 and appcompatv7, after removing support-v4 and appcompatv7 I am still able to use all the classes from support-v4 and appcompatv7 by just having support-design. Can anyone clarify this?
All I am trying to do is remove support-v4 from my project and only including the indpendent modules from support-v4 such as support-compat, support-coreui, etc. However, if support-design adds support-v4 automatically this doesn't seem possible. I have removed support-v4 from gradle and appcompat-v7 and all the classes from support-v4 are still found in my project by just keeping support-design.
Technically, it depends on your point of view.
You don't need to specify them in your dependencies but
designstill needs all those classes at compile time and runtime. Gradle + maven take care of automatically fetching these transitive dependencies.Here's the dependency graph of a recent version of
designsupport library:(*) denotes a dependency already mentioned before.
While researching the above tree I can, to my own surprise, confirm this.
For now you can try explicitly removing
support-v4fromdesigndependencies and see where that leads you (i.e. you may crash because of missing classes).If you do crash import the missing libraries until you don't.
Apparently the Android Team has fixed this and will ship in the next support library.