1

I noticed that some of my dependency like Jetpack Navigation and Firebase UI both depends on Material Component library. Unfortunately they have different version of Material Component and I decided to add the latest version manually in my project app level Gradle. Will there be a 3 version of Material Component on my project or only the latest version will be use?

Bitwise DEVS
  • 2,858
  • 4
  • 24
  • 67

1 Answers1

1

That's the work of Gradle.

If you run the target dependencies , you will see all dependencies your libraries are using. Like the following screenshot : Running Gradle dependencies And you can see more clearly which library is will be taken over another one. If you see for example an (*) it means that library or sub-library is omitted and will be ignored. Probably gradle is planning to take a more recent one.

In general, as far as I know, one of the behaviour when the artefactId and groupId are the same : it takes only the more recent dependency of that library and will not import the older version.

You will more probably need this link to check your dependencies if the screenshot is not enough : https://stackoverflow.com/a/39020703/10202308

Ahmed
  • 395
  • 3
  • 12
  • 3
    Here's the gradle documentation about how they resolve dependencies if you're interested: https://docs.gradle.org/current/userguide/dependency_resolution.html#sec:version-conflict – cactustictacs Apr 03 '22 at 00:53