Skip to content

Gradle Plugin Id Not Found Fix

DodaTech Updated 2026-06-24 3 min read

In this tutorial, you'll learn about Gradle Plugin Id Not Found Fix. We cover key concepts, practical examples, and best practices.

Your Gradle build fails with Plugin [id: 'xxx'] was not found, Could not find plugin with id, or Plugin request for plugin already on the classpath must not include a version — the plugin repository is missing, the plugin ID is wrong, or the version does not exist.

Step-by-Step Fix

1. Add the plugin repository

// settings.gradle (Gradle 7.0+)
// Wrong: missing plugin repository
pluginManagement {
    repositories {
        google()
        mavenCentral()
    }
}

// Right: add the Gradle Plugin Portal
pluginManagement {
    repositories {
        gradlePluginPortal()  // Required for most Gradle plugins
        google()              // For Android plugins
        mavenCentral()        // For general dependencies
        maven { url 'https://jitpack.io' }  // For JitPack hosted plugins
    }
}

2. Fix the plugin declaration

// build.gradle (project-level)
// Wrong: incorrect plugin ID or version
plugins {
    id 'com.android.application' version '8.9.9'  // Version may not exist
    id 'com.google.gms.google-services'  // Missing version for non-core plugin
}

// Right: use the correct plugin ID and version
plugins {
    id 'com.android.application' version '8.2.0' apply false
    id 'com.google.gms.google-services' version '4.4.0' apply false
}

// app/build.gradle
plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
}

3. Use the legacy apply plugin syntax

// build.gradle (older syntax if plugins block is not supported)
// Wrong: missing buildscript dependency
apply plugin: 'com.android.application'

// Right: add the plugin as a buildscript dependency
buildscript {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:8.2.0'
        classpath 'com.google.gms:google-services:4.4.0'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

4. Fix version catalog plugin declarations

# gradle/libs.versions.toml
# Wrong: incorrect plugin key
[plugins]
agp = { id = "com.android.application", version = "8.9.9" }

# Right: use the correct version from the catalog
[versions]
agp = "8.2.0"

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
google-services = { id = "com.google.gms.google-services", version = "4.4.0" }
// build.gradle
plugins {
    alias(libs.plugins.android.application)
    alias(libs.plugins.google.services)
}

5. Fix Android Studio plugin sync issues

# Sometimes Android Studio's plugin cache gets stale
# File > Invalidate Caches > Invalidate and Restart

# Then clean the project
./gradlew clean
rm -rf .gradle/

# Re-sync
./gradlew build --refresh-dependencies

6. Check for typos in the plugin ID

// Common plugin IDs and their correct spelling:
// Wrong:                        Right:
// 'com.android.application'     'com.android.application' ✓
// 'com.google.service'          'com.google.gms.google-services'
// 'kotlin-android'              'org.jetbrains.kotlin.android'
// 'spring.boot'                 'org.springframework.boot'
// 'docker'                      'com.bmuschko.docker-remote-api'

// Always check the plugin's official documentation for the exact ID
# Open the Gradle Plugin Portal in a browser
# https://plugins.gradle.org/

# Search for the plugin and copy the exact plugin ID and version
# Example: For the Kotlin plugin, search "kotlin android"

Prevention

  • Always use the plugins {} block instead of the legacy apply plugin: syntax for new projects.
  • Check the plugin ID and version on the Gradle Plugin Portal before adding it.
  • Use a version catalog (libs.versions.toml) to manage plugin versions centrally.
  • Add the gradlePluginPortal() repository in pluginManagement.
  • After adding a new plugin, run ./gradlew build --refresh-dependencies.

Common Mistakes with plugin not found

  1. Forgetting that lazy evaluation defers computation until the value is forced, causing space leaks with unevaluated thunks
  2. Using return to exit a function early instead of wrapping a pure value in the monad
  3. Mixing let bindings with <- bindings in do notation, producing type errors

These mistakes appear frequently in real-world GRADLE code. DodaTech's contributors have identified these patterns through analysis of open-source projects and production systems.

Practice Exercise

Write a pure function that safely divides two integers using Maybe, then test it with edge cases like division by zero and negative numbers.

This exercise reinforces the concepts covered in this guide. Try implementing it before checking online solutions.

FAQ

What is the difference between `plugins {}` and `apply plugin:`?

The plugins {} block is the modern, type-safe way to add plugins. It resolves plugins from the Gradle Plugin Portal automatically. The apply plugin: syntax is older and requires a buildscript dependency. |||Why do some plugins need version while others don't? Core plugins (like java or application) are bundled with Gradle and don't need a version. Community plugins require a version to resolve from the plugin repository. |||Can I use a SNAPSHOT version of a plugin? Yes, but you must add the snapshot repository: maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }. SNAPSHOT versions are not recommended for production builds.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro