Safeguard
Developer Tools•

What do google() and mavenCentral() each host in an Android build?

google() serves AndroidX, Play services, Firebase and other Google libraries; mavenCentral() serves the wider open source set. Declare both and filter.

Safeguard Security Team
3 min read

In an Android build, google() points to Google's Maven repository, which hosts AndroidX, Architecture Components, Play services, Play Billing, Firebase and related libraries. mavenCentral() points to Maven Central for the wider open source ecosystem. New Android Studio projects declare both in the settings file, in that order.

What each one is for

Android's documentation says new Android Studio projects specify Google's Maven repository and Maven Central as the repository locations in the settings file. It lists libraries available from Google's Maven repository, including:

  • AndroidX libraries and Architecture Components
  • Constraint Layout and Databinding
  • AndroidX Test
  • Wear OS and the Instant App library
  • Google Play services and Play Billing
  • Firebase

Everything else, such as most third party libraries, comes from Maven Central or another repository you add.

A short history note

The docs state that JCenter, which was included by default in the past, became read-only on March 31st, 2021. If an older project still lists it, remove it and confirm every dependency resolves elsewhere. A repository that no longer accepts new releases cannot ship fixes.

The default block

The docs show this block in the settings file:

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}

The FAIL_ON_PROJECT_REPOS mode fails the build if a project declares its own repository, so only the settings level list is used. That is the property you want when you care where code comes from.

Order and trust

The docs state that the order of listing determines the search order, so if both repositories have a dependency, the first one listed supplies it. The docs we read do not mention content filtering. You can add it yourself, so Google's repository answers only for its groups and the public one is not asked for them. The technique is in keeping private groups off public repos.

Checklist

CheckPass condition
Repositories declared in settingsOne list, reviewed
Project level repositoriesNone, enforced by FAIL_ON_PROJECT_REPOS
JCenterAbsent
Custom repositoriesEach has an owner and a filter
mavenLocalAbsent from release builds
OrderIntentional and documented

Steps

  1. Open the settings file and the root build file.
  2. Compare their repository lists to the table.
  3. Set FAIL_ON_PROJECT_REPOS if it is not set.
  4. Add filters for any custom repository.
  5. Run a clean build and review where artifacts resolved.

For the longer treatment of Android repositories, see how to control where Gradle downloads Android dependencies from.

Try it yourself

Click through it at your own pace, or open it full screen.

Open a few components and note which ecosystem each belongs to.

Safeguard's dependency scanning and SBOM generation cover Android Gradle projects, and the free scan at gold.safeguard.sh/scan lets you try it on yours.

Quick check

Do I need both repositories?

Most Android apps do, since AndroidX and Play services come from Google's repository and many other libraries from Maven Central.

Is JCenter still used?

The Android docs say it became read-only on March 31st, 2021, so it should not appear in current builds.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.