Using compose bom in library results in resolved empty version in a non-bom module

135 Views Asked by At

I'm working on a library Central Compose Library that uses Compose BOM version 2023.05.01. We also have a library Small Team Library, which is not on Compose BOM, that depends on the Central Compose Library.

The Small Team Library is part of Main App which is also using Compose BOM.

Traditionally, the default dependency resolution means that the versions of CCL are downloaded when CCL is added as a dependency in STL. However, for some reason, Gradle seems to be resolving CCL's Compose BOM libraries as a straight up empty version (instead of using the real version that has been resolved using CCL's Compose BOM version).

We don't see this issue when directly adding dependency on CCL in Main App, but we do when CCL is a dependency added to the Small Team Library.

For this reason, if the STL does not have a direct dependency on ALL compose libraries that are used in CCL, the Gradle dependency resolution will fail because it believes (rightfully so) that the version with no version number does not exist.

It's apparent when looking at the stack trace. Notice the strange empty space between the final colon and the dot, indicating no version number is found.

> Could not resolve all files for configuration ':small-teamlibrary:debugRuntimeClasspath'.
   > Could not find androidx.compose.ui:ui-tooling: .

Short of forcing all STLs to be using Compose BOM right away company wide, is there a better solution for this?

Using api platform(libs.compose.compose.bom) instead of implementation did not resolve the issue.

0

There are 0 best solutions below