Skip to content

Android Gradle Plugin Not Found

Problem Statement

When creating or opening an Android project in Android Studio, you encounter the error:
Plugin [id: 'com.android.application', version: '8.0.2', apply: false] was not found in any of the following sources.

This error prevents project synchronization and occurs due to misconfigured dependencies, network issues, or environmental conflicts. New projects in the latest Android Studio versions are particularly susceptible.

Common Causes

  • ❌ Incorrect settings.gradle configuration
  • 🌐 Internet connectivity restrictions or proxy misconfiguration
  • 🔌 Android Studio running in offline mode
  • 🔄 Mismatch between Gradle version and Android Gradle Plugin (AGP)
  • 🧩 Duplicate or conflicting settings.gradle files
  • ☕ Java version incompatible with Gradle requirements

1. Configure Plugin Management Correctly

Ensure your settings.gradle(.kts) file includes proper repository declarations:

kotlin
pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}
rootProject.name = "YourProjectName"
include(":app")

For .gradle files:

groovy
pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
    }
}
rootProject.name = "YourProjectName"
include ':app'

Critical

If you have multiple settings.gradle files (e.g., one per module), consolidate all include statements into the main project's settings file. Delete any extra copies.

2. Network Connectivity and Proxy Fixes

If behind restricted network/firewall:

text
# Add proxy configuration if required
systemProp.socksProxyHost=127.0.0.1
systemProp.socksProxyPort=2080

# OR remove existing proxy settings if misconfigured
# Delete all systemProp.http.proxy* lines

Verify access to Google's Maven repository:

bash
curl https://dl.google.com/dl/android/maven2/index.xml

Regional Restrictions

Users in regions with restricted Google services may need:

  • Valid DNS service configuration
  • VPN connection
  • Regional proxy compliant with local regulations

3. Version Compatibility Verification

Maintain compatibility between Gradle and Android Gradle Plugin:

text
# Use distribution URL matching required version
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
Compatibility Reference (AGP ↔ Gradle)
AGP VersionGradle Version
8.1+8.0+
7.5+7.3.3+
🔍 Always check the official Android compatibility table

4. Key Environment Checks

  • Disable offline mode
    Go to:
    Settings > Build, Execution, Deployment > Gradle > Offline work → Uncheck box

  • JDK Compatibility
    Configure under:
    File → Project Structure → SDK Location → JDK version
    Use JDK 17+ for AGP 8.0+

  • Gradle cache reset
    Run in terminal:

    bash
    ./gradlew clean build --refresh-dependencies

    Or manually delete ~/.gradle/caches folder

5. Other Proven Fixes

  • Correct missing .0 in versions:

    diff
    - id 'com.android.application' version '8.2'
    + id 'com.android.application' version '8.2.0' apply false
  • Delete .gradle directory in project root and restart Android Studio

  • Match Kotlin version compatibility (1.7.20+ for Gradle 8)

Outdated Solution Warning

Avoid downgrading AGP/Gradle versions as a primary fix. Compatibility updates provide security patches and performance improvements necessary for modern Android development.