Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Flutter and app store releases

Gradle cannot resolve material3 when its version should come from the Compose BOM

Your error

Failed to resolve: androidx.compose.material3:material32 more lines it can show

Fix it fast

Most common cause, 1 of 2

The BOM is in the catalog but not imported with platform()

Wrap the BOM in platform() in the dependencies block, and keep the Compose libraries without versions.

Fix
# gradle/libs.versions.toml
[versions]
composeBom = "2026.11.01"

[libraries]
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }

// app/build.gradle.kts
dependencies {
    val composeBom = platform(libs.androidx.compose.bom)
    implementation(composeBom)
    androidTestImplementation(composeBom)
    implementation(libs.androidx.compose.material3)
}
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

Failed to resolve: androidx.compose.material3:material3 with no version means nothing supplied one. A Compose BOM listed in libs.versions.toml does not affect resolution until each module that declares unversioned Compose libraries imports it with implementation(platform(libs.androidx.compose.bom)). With BOM 2026.11.01 and AGP 9, material3 then resolves to 1.5.0.

  • Applies to Compose BOM 2026.11.01, material3 1.5.0, Android Gradle Plugin 9.5, Gradle 9.9
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Print the compile classpath of the module that fails. If compose-bom shows up with material3 listed under it, the BOM works there; if material3 appears on its own line marked FAILED, that module has no BOM import.

Run this first
./gradlew :app:dependencies --configuration debugCompileClasspath | grep -E "compose-bom|material3"

Then find the line you see in this list and open its fix:

  1. 1The BOM is in the catalog but not imported with platform()The dependency report lists compose-bom as a plain entry with nothing under it, or does not list it at all, and material3 FAILED
  2. 2Another module uses material3 without its own BOM importThe app module resolves fine, but a library module such as :core:ui fails with Could not find androidx.compose.material3:material3:.

What does the error look like?

  • Failed to resolve: androidx.compose.material3:material3
  • Could not find androidx.compose.material3:material3:.
  • androidx.compose.material3:material3 FAILED

Cause 1 of 2

The BOM is in the catalog but not imported with platform()

You seeThe dependency report lists compose-bom as a plain entry with nothing under it, or does not list it at all, and material3 FAILED

Check

Failed to resolve material3 here comes from a BOM that is declared but never imported as a platform. Gradle states that version catalogs centralise versions but do not affect resolution, and a BOM only supplies versions when it is added with the platform() modifier; implementation(libs.androidx.compose.bom) on its own leaves material3 without a version.

Check
grep -n "compose.bom" app/build.gradle.kts gradle/libs.versions.toml

Fix

Wrap the BOM in platform() in the dependencies block, and keep the Compose libraries without versions.

Fix
# gradle/libs.versions.toml
[versions]
composeBom = "2026.11.01"

[libraries]
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }

// app/build.gradle.kts
dependencies {
    val composeBom = platform(libs.androidx.compose.bom)
    implementation(composeBom)
    androidTestImplementation(composeBom)
    implementation(libs.androidx.compose.material3)
}

Verify

The report now shows material3 with the version taken from the BOM, marked (c) for a constraint.

Verify
./gradlew :app:dependencies --configuration debugCompileClasspath | grep material3

Confirmed by docs.gradle.org

Did this fix it?

Cause 2 of 2

Another module uses material3 without its own BOM import

You seeThe app module resolves fine, but a library module such as :core:ui fails with Could not find androidx.compose.material3:material3:.

Check

Failed to resolve material3 in only one module means that module declares the library but not the BOM. Every module resolves its own classpath, and Google's BOM guide says to import the BOM in the module's own build file, so an import in :app does not give :core:ui a version.

Check
grep -rln "compose.material3" --include=build.gradle.kts .
grep -rln "compose.bom" --include=build.gradle.kts .

Fix

Add the platform import to each module that lists Compose libraries, or move the import into a convention plugin that all Compose modules apply.

Fix
// core/ui/build.gradle.kts
dependencies {
    implementation(platform(libs.androidx.compose.bom))
    implementation(libs.androidx.compose.material3)
}

Verify

The library module's report shows material3 with a version, and a full build passes.

Verify
./gradlew :core:ui:dependencies --configuration debugCompileClasspath | grep material3

Confirmed by developer.android.com

Did this fix it?

How do I stop it coming back?

  • Put the Compose BOM import in one convention plugin that every Compose module applies, so no module can forget it.
  • When you need a newer material3 than the BOM maps, keep the platform import and give only that library an explicit version, as Google's BOM guide shows.
  • Check the BOM to library mapping page before upgrading the BOM, so you know which material3 version you will get.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine on the same stack: QistLock, Nuclear Home Video.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.