Skip to content
Latchkey

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.pom

Common 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

  1. Declare google() in dependencyResolutionManagement in settings.
  2. 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

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →