others-how to solve `The project is using an incompatible version (AGP 7.3.1) of the Android Gradle plugin. Latest supported version is AGP 7.2.2` problem?

1. Purpose

In this post, I will introduce how to solve the The project is using an incompatible version (AGP 7.3.1) of the Android Gradle plugin. Latest supported version is AGP 7.2.2 problem when trying to build an android app in android studio.



2. Solution

What is AGP?

The Android Gradle plugin (AGP) is the official build system for Android applications. It includes support for compiling many different types of sources and linking them together into an application that you can run on a physical Android device or an emulator.

solution from stackoverflow:

Try either to upgrade Android Studio or change AGP version to the stable version like for example 7.2.1 in the project’s build.gradle file and sync the project: ```gradle buildscript { //… dependencies { classpath ‘com.android.tools.build:gradle:7.2.1’

    // ...
} } ```

change from versions.android_gradle_plugin = ‘7.3.1’

to :versions.android_gradle_plugin = ‘7.2.1’

because we are using android gradle plugin(AGP) too new for this android studio, so we need to downgrade the plugin to a stable version 7.2.1 which matches our android studio.

Now it works!



3. Summary

In this post, I demonstrated how to solve The project is using an incompatible version (AGP 7.3.1) of the Android Gradle plugin. Latest supported version is AGP 7.2.2 problem, the key point is to choose the correct AGP version that matches your android studio. That’s it, thanks for your reading.