Error1, 0 Plugin with id 'com.android.application' not found
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
The error Plugin with id 'com.android.application' not found means Gradle cannot locate the Android Gradle Plugin (AGP). This typically happens because the plugin repository is not declared in the project-level build.gradle (or settings.gradle for newer projects), the AGP dependency is missing from the buildscript classpath, or there is a version mismatch between AGP and the Gradle wrapper. The fix depends on whether your project uses the legacy buildscript block or the modern plugins DSL.
The Error
Fix 1: Legacy buildscript Configuration
The google() repository must be in the buildscript.repositories block for Gradle to download the Android plugin.
Fix 2: Modern plugins DSL (AGP 7.0+)
In the modern setup, repositories are declared in settings.gradle.kts under pluginManagement, and plugin versions are declared in the root build.gradle.kts with apply false.
Fix 3: Gradle Version Compatibility
An incompatible Gradle version cannot resolve the AGP plugin, producing the "not found" error.
Fix 4: Network and Proxy Issues
Gradle must download the plugin from google() repository. Network issues, firewall rules, or proxy misconfigurations cause download failures.
Fix 5: Check File Structure
Opening the app/ subdirectory directly in Android Studio instead of the project root causes Gradle to miss the project-level configuration.
Common Pitfalls
- Missing
google()repository: Thegoogle()repository hosts the Android Gradle Plugin. Without it inbuildscript.repositories(legacy) orpluginManagement.repositories(modern), Gradle cannot find the plugin. - Opening the wrong directory in Android Studio: Opening the
app/module directory instead of the project root means Gradle does not see the rootbuild.gradleorsettings.gradle, causing the plugin resolution to fail. - AGP and Gradle version mismatch: Each AGP version requires a specific minimum Gradle version. Using AGP 8.x with Gradle 7.x causes plugin resolution failures. Check the compatibility table.
- Mixing buildscript and plugins DSL: Using both
buildscript { classpath ... }andplugins { id(...) }for the same plugin causes conflicts. Pick one approach and use it consistently. - Gradle cache corruption: A failed download can leave corrupted artifacts in
~/.gradle/caches/. Delete the cache directory and rebuild to force a fresh download.
Summary
- Ensure
google()is inbuildscript.repositories(legacy) orpluginManagement.repositories(modern) - Add
classpath 'com.android.tools.build:gradle:VERSION'in the buildscript block, or declare plugin version in rootbuild.gradle.kts - Match AGP version to Gradle wrapper version (AGP 8.x needs Gradle 8.x)
- Open the project root directory in Android Studio, not the
app/subdirectory - Clear
~/.gradle/caches/and rebuild if you suspect cache corruption - Check network/proxy settings if Gradle cannot download dependencies

