/errors/gradle/plugin-was-not-found-in-any-of-the-following-sources
Gradle: Plugin [id: 'com.example.plugin', version: '1.0'] was not found in any of the following sources
- tool
- Gradle
- exit code
- 1
- versions
- Gradle 6 – 9
- os
- any
Plugin [id: 'com.example.plugin', version: '1.0'] was not found in any of the following sources: means Gradle looked for the plugin requested in the plugins { } block in every plugin source it knows (core plugins, included builds, and the plugin repositories) and none of them had that id at that version. The lines after the message list each source and why it did not match. Check the id and version, then make sure the repository that publishes the plugin is declared in pluginManagement { repositories { } } in settings.gradle(.kts).
Reading the message
Gradle builds the message in PluginResolutionResult: one line per source, with the reason in parentheses. For a plugin repository, the reason names the artifact Gradle tried to resolve and the repositories it searched, for example:
- Plugin Repositories (could not resolve plugin artifact 'org.myplugin:org.myplugin.gradle.plugin:1.0')
Searched in the following repositories:
Gradle Central Plugin RepositoryThe artifact ID:ID.gradle.plugin:VERSION is the plugin marker that every plugin published with java-gradle-plugin has. If the repositories list does not include the one that hosts your plugin, that is the fix.
Fix
Declare the plugin repositories in settings.gradle.kts (the same block works in Groovy settings.gradle):
pluginManagement {
repositories {
gradlePluginPortal()
google() // Android Gradle Plugin
mavenCentral()
maven("https://repo.company.example/plugins") // replace with your repository
}
}Then request the plugin with its exact id and a published version:
plugins {
id("com.example.plugin") version "1.0.2"
}