Gradle says the com.android.application plugin was not found
org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.android.application', version: '7.0.0-rc01'] was not foundShort 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.
Fix it fast
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 .2Match what you see, then jump to its fix
- 1
The pluginManagement block has no google() entry, or the block is missing from the settings file.google() is missing from the pluginManagement repositoriesFix - 2
The 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
- 1
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 projectsConfirmed by developer.android.com
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 projectsConfirmed by docs.gradle.org
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
adb cannot start because something already holds its port
adb start-server failed
The adb server must bind local TCP port 5037, and every adb client talks to it there.
2 causes, each with a fixMobile apps
The phone shows as unauthorized and Android Studio will not run the app
adb devices lists the phone but Android Studio cannot deploy to it
An unauthorized phone means it has not trusted this computer's RSA key.
3 causes, each with a fixMobile 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 fixMobile apps
adb cannot connect to its daemon or start the server
* daemon started successfully *
The adb server is a background process on your computer that listens on TCP port 5037.
2 causes, each with a fixMobile apps
adb prints 'server version doesn't match this client; killing...'
adb server version doesn't match this client; killing...
adb runs a background server, and every adb command is a client.
3 causes, each with a fixMobile 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