Maaz Zindani

Loading the index…

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

Gradle says the com.android.application plugin was not found

Errororg.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.android.application', version: '7.0.0-rc01'] was not found

Short answer

Gradle only looks for plugins in the repositories listed in pluginManagement in settings.gradle(.kts); without one it uses the Gradle Plugin Portal, and the Android plugin has to come from a repository you list. Add google() to that block, and make sure the AGP version in your plugins block is a release that actually exists.

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

Fix it fast

  1. 1Find out which cause you have

    Print the top of the settings file. Look at which repositories sit inside the pluginManagement block, and note the AGP version used in the plugins block.

    sed -n 1,30p settings.gradle.kts   # or settings.gradle
    grep -rn "com.android.application" --include=*.gradle --include=*.kts --include=*.toml .
  2. 2Match what you see, then jump to its fix

    1. 1The pluginManagement block has no google() entry, or the block is missing from the settings file.google() is missing from the pluginManagement repositoriesFix
    2. 2The version in the message is a preview such as an rc or beta build, or a version with a typo.The AGP version in the plugins block does not exist in the repositoryFix

What does the error look like?

  • org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.android.application', version: '7.0.0-rc01'] was not found

Cause 1 of 2

google() is missing from the pluginManagement repositories

1Check

Gradle resolves plugins declared in the plugins block from the repositories in pluginManagement in the settings file, and falls back to the Gradle Plugin Portal by default. Android's own default settings file lists google() in that block next to gradlePluginPortal() and mavenCentral(). The dependencyResolutionManagement block is a different thing and does not apply to plugins.

grep -n -A6 "pluginManagement" settings.gradle*

2Fix

Put google() into pluginManagement.repositories. The pluginManagement block must be the first block in the settings file.

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

3Verify

Run a Gradle command that configures the project, or press Sync in Android Studio. The plugin now resolves.

./gradlew projects

Confirmed by developer.android.com

Did this fix it?

Cause 2 of 2

The AGP version in the plugins block does not exist in the repository

1Check

Gradle finds a plugin by a marker artifact built from the plugin id and the exact version. If the repository has no artifact for that exact version, the plugin counts as not found, even when google() is configured. Compare the version with the released versions in the Android Gradle plugin release notes.

grep -rn "com.android.application" --include=*.gradle --include=*.kts --include=*.toml .

2Fix

Change the version to a released AGP version that suits your Gradle and JDK (see the compatibility table in the release notes). If you use a version catalog, change agp in gradle/libs.versions.toml instead.

# gradle/libs.versions.toml
[versions]
agp = "8.3.0"          # example: replace with a released version
[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }

3Verify

Sync the project again; if the version and repositories are right, configuration finishes without the error.

./gradlew projects

Confirmed by docs.gradle.org

Did this fix it?

How do I stop it coming back?

  • Keep settings.gradle(.kts) as Android Studio generated it: pluginManagement first, with google() in it.
  • Pin AGP to a released version, never a dynamic version such as 3.+.
  • Upgrade AGP with the AGP Upgrade Assistant in Android Studio so Gradle and plugin versions move together.

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

Mobile apps

adb tcpip 5555 fails because no device is found

adb: more than one device/emulator

adb tcpip only works while the device is attached and listed by adb, because it tells the phone to start listening on port 5555.

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.