Maaz Zindani

Loading the index…

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

Gradle says the plugin id you asked for does not exist in any repository it searched

ErrorPlugin [id: 'com.android.application', version: '8.x.x', apply: false] was not found in any of the following sources:

Short answer

Gradle searched every repository listed for plugins and none had that id at that version. Read the list under the error: it shows where Gradle looked. Then check three things in order: the repository that hosts the plugin is in pluginManagement, the id and version really exist, and a private repository has the plugin marker.

  • Applies to Gradle 8.x and 9.x, Android Gradle plugin 8.x and 9.x, Android Studio current stable
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Run any task and read the full list of sources printed below the error. If Google's Maven repository is not in that list, the first cause applies. If it is there, the id or version is wrong.

    ./gradlew help --stacktrace
  2. 2Match what you see, then jump to its fix

    1. 1The list of sources shows only the Gradle Central Plugin RepositoryThe repository that hosts the plugin is not in pluginManagementFix
    2. 2The repository is listed, but the error still names a version you never published or installedThe plugin id or version does not existFix
    3. 3A company plugin id fails while its jar is clearly in the repositoryA private repository has the jar but not the plugin markerFix

What does the error look like?

  • Plugin [id: 'com.android.application', version: '8.x.x', apply: false] was not found in any of the following sources:
  • Gradle Central Plugin Repository (no 'google()' listed)
  • Plugin 'com.example.plugin' was not found in any of the following sources

Cause 1 of 3

The repository that hosts the plugin is not in pluginManagement

1Check

A plugin in the plugins block is searched for in the repositories declared inside pluginManagement in settings.gradle(.kts). Nothing else counts, and that block must be the first one in the file. The Android Gradle plugin is published on Google's Maven repository, not on the Plugin Portal.

sed -n '1,25p' settings.gradle.kts settings.gradle 2>/dev/null

2Fix

Put pluginManagement first in the settings file and list google() in it, ahead of the portal.

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

3Verify

The failing list now includes the repository, and the build moves on to the next step.

./gradlew help

Confirmed by docs.gradle.org

Did this fix it?

Cause 2 of 3

The plugin id or version does not exist

1Check

A typo in the id, or a version number that was never released, produces the same message. Compare the id and version in the root build file, or the version catalog, with the compatibility table in the Android Gradle plugin release notes.

grep -rn "com.android\|agp" build.gradle* gradle/libs.versions.toml

2Fix

Use one released version, written once. In a version catalog it lives under versions and the plugin entry points at it. For a single module you can also set it directly in the plugins block.

# gradle/libs.versions.toml
[versions]
agp = "9.5.1"

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }

3Verify

Sync again. The plugin resolves and the next error, if any, is a different one.

./gradlew help

Confirmed by developer.android.com

Did this fix it?

Cause 3 of 3

A private repository has the jar but not the plugin marker

1Check

Gradle looks for a marker artifact named after the plugin id (id:id.gradle.plugin:version). A repository that only holds the implementation jar cannot answer the lookup.

curl -I https://repo.example.com/maven/com/example/plugin/com.example.plugin.gradle.plugin/1.0.0/

2Fix

Publish the marker with the java-gradle-plugin, or map the id to the implementation module in pluginManagement.

// settings.gradle.kts
pluginManagement {
    resolutionStrategy {
        eachPlugin {
            if (requested.id.id == "com.example.plugin") {
                useModule("com.example:plugin-impl:${requested.version}")
            }
        }
    }
}

3Verify

The plugin id resolves from the private repository.

./gradlew help

Confirmed by docs.gradle.org

Did this fix it?

How do I stop it coming back?

  • Keep pluginManagement as the first block of settings.gradle(.kts), with google() in it from the first commit.
  • Declare the Android Gradle plugin version in one place, the version catalog.
  • Copy plugin ids and versions from the release notes instead of typing them.

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.