Android "Could not find google() repository" in CI
A Google-hosted artifact (AndroidX, AGP, Play services) cannot be found because the google() repository is not in the resolution list.
What this error means
The build fails with Could not find androidx.... or a note that the artifact is not in the searched repositories, which omit google().
gradle
Could not find androidx.core:core-ktx:1.12.0.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/androidx/core/core-ktx/1.12.0/core-ktx-1.12.0.pomCommon causes
google() not declared
AndroidX and Google libraries live in Google Maven; without google() Gradle only searches Maven Central.
Repositories centralized but incomplete
With dependencyResolutionManagement set to FAIL_ON_PROJECT_REPOS, only the central list is used and it is missing google().
How to fix it
Add google() to the central repositories
- Declare google() in dependencyResolutionManagement in settings.
- Keep mavenCentral() alongside it.
settings.gradle.kts
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
}Confirm the artifact coordinates
Verify the group, name, and version exist in Google Maven before assuming a repository issue.
How to prevent it
- Always include google() and mavenCentral() in centralized repositories and cache dependencies to reduce fetches.
Related guides
Android "Could not resolve com.android.tools.build:gradle" in CIFix the Android "Could not resolve com.android.tools.build:gradle" error in CI by adding the google() reposit…
Android "Failed to install SDK packages (licenses not accepted)" in CIFix the Android "Failed to install the following SDK packages as some licences have not been accepted" error…
Android "Duplicate class found" in CIFix the Android "Duplicate class found in modules" error in CI by excluding the duplicate dependency or align…