When building a project with Gradle, you may encounter the error “Plugin with id not found”.
This error occurs when Gradle cannot find the plugin corresponding to the specified plugin ID.
Possible causes include an incorrect plugin ID, a required plugin not being loaded, insufficient repository settings, incompatible Gradle and plugin versions, or using the structure of an old Gradle project.
This article explains the main causes and solutions in order when “Plugin with id not found” appears in Gradle.
- What Is “Plugin with id not found”?
- Cause 1: The Plugin ID Is Incorrect
- Cause 2: The Required Plugin Has Not Been Loaded in buildscript
- Cause 3: Settings Are Incomplete in a Project Migrated to the plugins Block
- Cause 4: The pluginManagement repositories Configuration Is Insufficient
- Cause 5: The Plugin Version Is Not Specified
- Cause 6: A Nonexistent Plugin Version Is Specified
- Cause 7: The Gradle and Plugin Versions Are Not Compatible
- Cause 8: The Combination of Android Gradle Plugin and Gradle Is Incompatible
- Cause 9: The Wrong Gradle File Is Used to Declare the Plugin
- Cause 10: Confusing the Syntax of build.gradle and build.gradle.kts
- Cause 11: Confusing the Old apply plugin Format with the New plugins Format
- Cause 12: There Is a Problem with the Network or Offline Mode
- Cause 13: Gradle Sync Has Not Completed Successfully
- Solutions to Check First
- Check the Plugin ID Displayed in the Error
- Difference Between “Plugin with id not found” and “Plugin was not found”
- Summary
What Is “Plugin with id not found”?
Gradle uses plugins to add functionality required by a project.
For example, an Android app uses a plugin like the following.
apply plugin: 'com.android.application'
Also, current Gradle projects may use the plugins block as follows.
plugins {
id 'com.android.application'
}
If Gradle cannot recognize the plugin with the specified ID, an error like the following may appear.
Plugin with id 'com.example.plugin' not found.
In this case, you need to check not only the plugin ID itself but also whether Gradle is in a state where it can use that plugin.
Cause 1: The Plugin ID Is Incorrect
The first thing to check is the plugin ID being specified.
If there is a spelling mistake in the plugin ID, Gradle cannot find the corresponding plugin.
apply plugin: 'com.android.aplication'
For example, if application is misspelled, correct it to the proper plugin ID.
apply plugin: 'com.android.application'
Because many plugin IDs have similar names, check whether the ID exactly matches the one listed in the official documentation.
Cause 2: The Required Plugin Has Not Been Loaded in buildscript
In older Gradle projects, before using apply plugin, the required plugin may be loaded in the root-side build.gradle.
For example, the Android Gradle Plugin may use a configuration like the following.
buildscript {
repositories {
google()
mavenCentral()
}
```
dependencies {
classpath 'com.android.tools.build:gradle:8.x.x'
}
```
}
If you try to apply the Android plugin without this configuration, Gradle may be unable to find the plugin ID.
In old-style Gradle projects, also check the dependencies inside buildscript.
Cause 3: Settings Are Incomplete in a Project Migrated to the plugins Block
In newer Gradle projects, using the plugins block instead of apply plugin is common.
plugins {
id 'com.android.application'
}
If only part of the project has been changed from the old format to the new format, the plugin version specification or repository settings may be incomplete.
There are also configurations where the plugin version is specified on the root project side as follows.
plugins {
id 'com.android.application' version '8.x.x' apply false
}
Check whether the current project uses the buildscript format or the plugins format.
Cause 4: The pluginManagement repositories Configuration Is Insufficient
Gradle searches the configured repositories for plugins specified in the plugins block.
If the required repositories are not configured, the plugin may not be found even if the plugin itself exists.
In settings.gradle or settings.gradle.kts, a configuration like the following may be used.
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
Android-related plugins may require google().
Plugins retrieved from the Gradle Plugin Portal may require gradlePluginPortal().
The required repositories vary depending on the plugin being used. Check the plugin’s official documentation.
Cause 5: The Plugin Version Is Not Specified
When using an external plugin in the plugins block, some plugins require a version specification.
plugins {
id 'com.example.plugin' version '1.0.0'
}
If the required version is not specified, or if a version setting that should be defined elsewhere has been removed, the plugin may fail to load.
Check where the plugin version is defined, such as on the root side of the project or in a version catalog.
Cause 6: A Nonexistent Plugin Version Is Specified
Even if the plugin ID is correct, the plugin cannot be retrieved if the specified version does not exist.
plugins {
id 'com.example.plugin' version '99.0.0'
}
Check whether there is a typo in the version number or whether you have specified a version that has not yet been released.
Check the plugin’s official website or official documentation for available versions.
Cause 7: The Gradle and Plugin Versions Are Not Compatible
Gradle plugins may support only certain versions of Gradle.
If you use a new plugin with a very old version of Gradle, or an old plugin with a new version of Gradle, it may not load correctly.
The Gradle version can usually be checked in gradle-wrapper.properties.
distributionUrl=https\://services.gradle.org/distributions/gradle-8.x-bin.zip
If the error occurs after changing the plugin version, also check the corresponding Gradle version.
Cause 8: The Combination of Android Gradle Plugin and Gradle Is Incompatible
In Android Studio projects, the combination of the Android Gradle Plugin (AGP) and Gradle is also important.
The supported Gradle version differs depending on the Android Gradle Plugin version.
If you update only the Android Gradle Plugin or only Gradle, compatibility problems may occur.
When opening an old Android project in a newer version of Android Studio, check both versions as well.
Cause 9: The Wrong Gradle File Is Used to Declare the Plugin
An Android Studio project has multiple Gradle files, such as one on the root project side and one on the app module side.
Depending on the plugin, some settings are written on the app module side while others are written on the root project side.
For example, the plugin for an Android app is normally applied on the app module side.
app/
└── build.gradle
If you add the plugin configuration to the wrong Gradle file, the plugin may not be recognized correctly.
Cause 10: Confusing the Syntax of build.gradle and build.gradle.kts
Gradle has build.gradle, which uses Groovy DSL, and build.gradle.kts, which uses Kotlin DSL.
With Groovy DSL, for example, it is written as follows.
plugins {
id 'com.android.application'
}
With Kotlin DSL, it is written as follows.
plugins {
id("com.android.application")
}
When copying settings from official documentation or GitHub, check whether the type and syntax of the Gradle file you are using match.
Cause 11: Confusing the Old apply plugin Format with the New plugins Format
Older Gradle projects may use the following apply plugin format.
apply plugin: 'com.android.application'
Newer projects may use the following plugins format.
plugins {
id 'com.android.application'
}
If the two formats are partially mixed, the plugin resolution method or version specification may no longer match.
Check which format is being used throughout the project.
Cause 12: There Is a Problem with the Network or Offline Mode
External plugins may be retrieved from repositories over the Internet.
Therefore, if there is a problem with the network connection or Gradle is in offline mode, the required plugin may not be retrieved.
In particular, immediately after adding a new plugin or changing the plugin version, the necessary files may not yet be stored locally.
Also check the Internet connection, proxy, firewall, Gradle offline settings, and other related settings.
Cause 13: Gradle Sync Has Not Completed Successfully
After modifying a Gradle file, if Gradle Sync has not completed successfully, the new plugin configuration may not be reflected.
After correcting the plugin ID, version, repository settings, and other settings, run Gradle Sync again.
If another error appears during Sync, check not only “Plugin with id not found” but also the errors displayed before and after it.
Solutions to Check First
If “Plugin with id not found” occurs, checking the following items in order can make it easier to narrow down the cause.
- Check the spelling of the plugin ID.
- Check whether the required plugin is loaded with
buildscriptorplugins. - Check the plugin version.
- Check the repository settings in
pluginManagement. - Check whether the plugin should be written on the root side or the app module side.
- Check whether the Gradle and plugin versions are compatible.
- For Android projects, check the combination of Gradle and the Android Gradle Plugin.
- Check whether Groovy DSL and Kotlin DSL are being confused.
- Check whether the
apply pluginformat andpluginsformat are being confused. - Check the network connection and offline mode.
- Run Gradle Sync again.
Check the Plugin ID Displayed in the Error
In the “Plugin with id not found” error, the plugin ID that could not be found may be displayed.
Plugin with id 'com.example.plugin' not found.
In this case, first search for the displayed plugin ID in the Gradle files.
Then check the spelling of the plugin ID, the settings used to load the plugin, the version, the repository settings, and other related settings to make it easier to identify the cause.
Difference Between “Plugin with id not found” and “Plugin was not found”
In Gradle, an error similar to “Plugin with id not found” called “Plugin was not found” may also appear.
Both may occur when the specified Gradle plugin cannot be used, but the displayed message may differ depending on the Gradle configuration being used and the method used to apply the plugin.
In particular, “Plugin with id not found” may appear with the old apply plugin format, while “Plugin was not found” may appear in configurations that use the plugins block.
In either case, it is important to check the plugin ID, plugin loading settings, version, repositories, and other related settings.
Summary
Gradle’s “Plugin with id not found” error occurs when Gradle cannot find the plugin corresponding to the specified plugin ID.
Main causes include an incorrect plugin ID, a required plugin not being loaded, insufficient repository settings in pluginManagement, incompatibility between Gradle and the plugin version, and confusion between the old apply plugin format and the new plugins format.
If the error occurs, first check the plugin ID displayed in the error message and the declaration in the Gradle file.
Then, by checking the plugin loading method, version, repositories, compatibility with Gradle, the type of Gradle file being used, and other related settings in order, you can efficiently narrow down the cause.
