Search code examples
androidandroid-studioandroid-gradle-plugin

Android Studio | Android Gradle Plugin version does not correspond with project version


This is the error I'm getting:

The project is using an incompatible version (AGP 7.3.1) of the Android Gradle plugin. Latest supported version is AGP 7.2.1

This error occurs when I attempt to sync the project with gradle files, but my build.gradle and project structure both specify version 7.2.1 as seen below.

build.gradle:

buildscript {
    dependencies {
        classpath("com.android.tools.build:gradle:7.2.1")
    }
}

Project structure: Version 7.2.1 in project structure

Gradle: 7.6.2 Android Studio: Chipmunk 2021.2.1

I have tried invalidating caches, reloading from disk, gradle clean etc. I have been unable to find any mention of version 7.3.1 anywhere, only within android studio build outputs.

What could possibly be causing this?


Solution

  • Update your Android Studio and you will be able to select AGP 7.3.1 and newer versions. Your Android Studio version is a bit old.

    1. Help->Check for updates... and update
    2. (Just in case): File->Invalidate Caches...->(select all)Invalidate and Restart
    3. Select your desired Gradle version and Android Gradle Plugin (AGP) version
    4. Clean and Build your project

    Hope it helps!