# Taming Bazel Dependency Conflicts: An Android Case Study

DevFeed: [Taming Bazel Dependency Conflicts: An Android Case Study](<https://devfeed.tech/articles/taming-bazel-dependency-conflicts-an-android-case-study-85771.md>)

Original publisher: [Read original article](<https://proandroiddev.com/taming-bazel-dependency-conflicts-an-android-case-study-44b7926839be?source=rss----c72404660798---4>)

Author: Taufik Amaryansyah

Published: 2026-10-12T23:38:04Z

Content type: tutorial

Language: en

Sources: [ProAndroidDev](<https://devfeed.tech/sources/proandroiddev-medium.md>)

Topics: [bazel](<https://devfeed.tech/topics/bazel.md>), [Dependency management](<https://devfeed.tech/topics/dependency-management.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [Maven](<https://devfeed.tech/topics/maven.md>), [Android](<https://devfeed.tech/topics/android.md>), [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [bazel](<https://devfeed.tech/tags/bazel.md>), [build-system](<https://devfeed.tech/tags/build-system.md>), [case-study](<https://devfeed.tech/tags/case-study.md>), [dependency](<https://devfeed.tech/tags/dependency.md>), [dependency-management](<https://devfeed.tech/tags/dependency-management.md>), [gradle](<https://devfeed.tech/tags/gradle.md>)

## AI overview

While updating an Android app to the Compose BOM 2024.12.01, the author hit conflicting AndroidX versions: `activity-compose:1.7.0` requested Compose UI 1.0.1, while the BOM supplied 1.7.6. The article contrasts Gradle's default newest-version selection with Bzlmod's minimal version selection, which chooses the earliest version explicitly required by the graph and does not automatically upgrade to a newer available release. The author says `version_conflict_policy = "pinned"` only pins successfully resolved versions; it does not fix the conflict. Their workaround is to run `bazel clean --expunge bazel run @maven//:pin`, save and inspect the full log for the conflicting artifact, add a `maven.artifact` version override before `maven.install`, then rerun pinning and repeat for other conflicts. They chose the newest listed version first, trying the next newest if errors remained. After several overrides, pinning and the app build succeeded. The author notes that updating Bazel rules can require configuration and Bazel version changes; the excerpt does not give the complete override configuration.

## Source excerpt

Illustration Generated by Gemini For many developers, "dependency conflict" is a phrase that instantly causes a headache. This is especially true when moving from a familiar ecosystem like Gradle to a powerful but complex tool like Bazel. A while back, I wrote about my experience building an Android app with Bazel (You can read about it here: Building a Modern Android Music Player App with Bazel...). Recently, I decided to update some libraries in that project, most notably by moving to the Compose BOM (androidx.compose:compose-bom:2024.12.01). 🧨 The Problem Begins: A Simple Library Update I updated my MODULE.bazel file with the new dependencies. The initial attempt looked something like this: https://medium.com/media/ab6ac611fb4ff73c1120f2dba1a8df3e/href I ran the build, and... it failed. I was greeted by a long, cryptic error log, which boiled down to a classic dependency conflict. Here's just a small snippet of the dependency graph hell: At its core, the problem was familiar. For example, looking at the log: androidx.activity:activity-compose:1.7.0 (which I was using) explicitly wants androidx.compose.ui:ui:1.0.1. But the new Compose BOM (2024.12.01) was pulling in androidx.compose.ui:ui:1.7.6 (a much newer version). This threw me for a loop. In my time with Gradle, I rarely faced conflicts this severe. Gradle usually seems "smart" enough to just pick the newest version and move on. 🧠 Understanding the "Why": Gradle vs. Bazel After some digging, I realized the fundamental difference lies in how these build tools manage versions. 1. Gradle: "Newest Version Wins" (By Default) Gradle, by default, uses a "Newest Version Selection" strategy. If it encounters a conflict, it simply picks the newest version of the dependency available in the graph. A -> C v1.0 B -> C v2.0 Gradle's Result: C v2.0 (Chosen automatically) 2. Bazel (Bzlmod): "Minimal Version Selection" (MVS) Bazel, with the introduction of Bzlmod, adopts the "Minimal Version Selection" (MVS) algorithm, which is als