Maaz Zindani

Loading the index…

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

Gradle cannot resolve a Google Play services library

ErrorFailed to resolve: com.google.android.gms:play-services-auth:11.4.0

Short answer

Play services libraries live in Google's Maven repository, so Gradle can only resolve them when google() is in your repositories block and the version you asked for is still published there. Add google(), then switch to the current version listed in the Play services setup guide.

  • Applies to Android Gradle plugin 8.x, Gradle 8.x, Android Studio 2025
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Print the dependency report for the module. The line marked FAILED (or with (n)) names the exact artifact Gradle could not find.

    ./gradlew :app:dependencies --configuration releaseRuntimeClasspath
  2. 2Match what you see, then jump to its fix

    1. 1Only com.google.android.gms artifacts fail, while Maven Central libraries resolve fineGoogle's Maven repository is not in the buildFix
    2. 2google() is present but one old version number such as 11.4.0 still failsThe version you asked for is not in Google's Maven repositoryFix
    3. 3The build fails with a repository error right after you add google() to a module's build fileA repository declared in the module is rejected by the settings fileFix

What does the error look like?

  • Failed to resolve: com.google.android.gms:play-services-auth:11.4.0

Cause 1 of 3

Google's Maven repository is not in the build

1Check

Open settings.gradle(.kts) and look in dependencyResolutionManagement { repositories { ... } }. Older projects keep the list in the root build file instead.

grep -n -E "google\(\)|maven.google.com" settings.gradle* build.gradle* 2>/dev/null

2Fix

Add google() to the repositories block. Google lists Play services among the libraries hosted there, and the order of repositories decides where Gradle searches first.

// settings.gradle.kts
dependencyResolutionManagement {
    repositories {
        google()
        mavenCentral()
    }
}

3Verify

Sync the project or run the dependency report again; the artifact no longer shows as failed.

./gradlew :app:dependencies --configuration releaseRuntimeClasspath

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 3

The version you asked for is not in Google's Maven repository

1Check

Google's Maven repository only serves the versions published there; older versions of these libraries are not available. Look up the group's page on maven.google.com to see the versions that exist.

curl -s https://maven.google.com/com/google/android/gms/play-services-auth/group-index.xml | head -c 400

2Fix

Use a current version from the Play services setup page instead of the old one. The page lists the coordinate and the latest version for each SDK.

dependencies {
    implementation("com.google.android.gms:play-services-auth:22.0.0")
}

3Verify

Sync and build; if the new major version changes an API, fix the compile errors it reports.

./gradlew :app:assembleDebug

Confirmed by developers.google.com

Did this fix it?

Cause 3 of 3

A repository declared in the module is rejected by the settings file

1Check

Look at repositoriesMode in settings.gradle(.kts). With FAIL_ON_PROJECT_REPOS, declaring a repository inside a project is a build error.

grep -rn "repositoriesMode" settings.gradle*

2Fix

Keep every repository in the settings file and remove the repositories block from the module build file.

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

3Verify

Sync the project again.

./gradlew help

Confirmed by docs.gradle.org

Did this fix it?

How do I stop it coming back?

  • Keep repository declarations in one place, the settings file, and do not repeat them per module.
  • Pin one Play services version per library and update it when Google's setup page lists a newer one.
  • Avoid dynamic versions such as 11.+, which the Android docs warn against.

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 built on the same technologies:

Related fixes

Mobile apps

Android Studio cannot pair the phone over Wi-Fi

The Pair devices over Wi-Fi dialog lists no device

Wireless pairing needs the phone on Android 11 or higher and on the same Wi-Fi network as the computer, with current Platform-Tools.

4 causes, each with a fix

Next step

Want this handled for good?

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