android build_error ai_generated true

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. > Could not find androidx.compose.material3:material3:1.2.0. Required by: project :app > > Cannot find a version of 'androidx.compose.material3:material3' that satisfies the version constraint '1.2.0'

ID: android/gradle-version-catalog-not-found

Also available as: JSON · Markdown · 中文
92%Fix Rate
87%Confidence
1Evidence
2023-09-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
Android Gradle Plugin 8.0 - 8.2 active
Gradle 8.0 - 8.5 active
Compose BOM 2023.10.01 - 2024.02.00 active

Root Cause

Version catalog or dependency declaration references a library version that does not exist in the configured repositories, or the repository (e.g., Maven Central, Google) is not reachable or missing the artifact.

generic

中文

版本目录或依赖声明引用了配置的仓库中不存在的库版本,或仓库(如 Maven Central、Google)不可达或缺少该工件。

Official Documentation

https://developer.android.com/build/dependencies#version-catalog

Workarounds

  1. 95% success Update the version catalog file (libs.versions.toml) to use a valid version from the Google Maven repository: 'material3 = "1.2.1"' and then run 'gradlew clean build'.
    Update the version catalog file (libs.versions.toml) to use a valid version from the Google Maven repository: 'material3 = "1.2.1"' and then run 'gradlew clean build'.
  2. 85% success Add the Google Maven repository explicitly in settings.gradle or build.gradle: 'maven { url "https://maven.google.com" }' and ensure it's before other repositories.
    Add the Google Maven repository explicitly in settings.gradle or build.gradle: 'maven { url "https://maven.google.com" }' and ensure it's before other repositories.

中文步骤

  1. Update the version catalog file (libs.versions.toml) to use a valid version from the Google Maven repository: 'material3 = "1.2.1"' and then run 'gradlew clean build'.
  2. Add the Google Maven repository explicitly in settings.gradle or build.gradle: 'maven { url "https://maven.google.com" }' and ensure it's before other repositories.

Dead Ends

Common approaches that don't work:

  1. 50% fail

    If the repository is already present but the artifact doesn't exist, adding it again won't help; the version must be verified.

  2. 50% fail

    Older versions may not be compatible with the current Compose or AndroidX libraries, causing other build failures.