Skip to content

Patched mainTemplate.gradle contains multiple versions of the same dependency #243

Closed
@glodos

Description

@glodos

Not sure if anyone has reported it yet, but one of the reasons our build failed after updating the resolver was adding duplicate dependencies with different versions when patching of mainTemplate.gradle file is enabled.

Our project contains many third party SDKs that depend on play services or android support libraries. Each SDK has its dependencies defined in the xml file or added dynamically in code. Dependency versions are different across SDKs, which is a normal thing. However, the resolver fails to pick only one dependency with highest version. Instead it picks each dependency and adds it to the mainTemplate.gradle file resulting in this:

...
implementation 'com.android.support:support-v4:25.3.1'
implementation 'com.android.support:support-v4:27.1+'
...

This results in failed build due to duplicate class definitions. We have to manually set dependency versions in xml files and source of third party SDKs to avoid this error. This case should be handled by the resolver by picking highest version automatically and ignoring other duplicate dependencies. Currently running resolver v1.2.119.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions