Gradle JVM version incompatible. This project is configured to use an older Gradle JVM that supports up to version 8 but the current AGP requires a Gradle JVM that supports version 17.
Change Gradle JDK... See AGP Release Notes...
The error message you're encountering indicates that your project is configured to use an older version of the Gradle JVM that is not compatible with the version of the Android Gradle Plugin (AGP) you are using. Specifically, it seems that your AGP requires a Java Development Kit (JDK) version of 17, while your project is currently set to use a version that only supports up to Java 8.
To resolve this issue, you need to update the Gradle JVM version in your project. Here are the steps to do that:
If you are using Android Studio or IntelliJ IDEA, follow these steps:
Open Project Structure:
File
> Project Structure
(or press Ctrl + Alt + Shift + S
).Select SDK Location:
SDK Location
.Set JDK Location:
JDK location
field, set the path to the JDK 17 installation directory.Apply Changes:
Apply
and then OK
to save the changes.If your project uses the Gradle Wrapper, you may also need to update the gradle-wrapper.properties
file to ensure it uses a compatible version of Gradle:
Locate gradle-wrapper.properties
:
gradle/wrapper
directory of your project.Edit the File:
gradle-wrapper.properties
and update the distributionUrl
to a compatible version of Gradle. For AGP that requires JDK 17, you might want to use Gradle 7.3 or higher. For example:distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
Sync the Project:
After updating the JDK and Gradle version, it's a good idea to clean and rebuild your project:
Clean the Project:
Build
> Clean Project
.Rebuild the Project:
Build
> Rebuild Project
.After following these steps, your project should now be configured to use JDK 17, and the compatibility issue with the Android Gradle Plugin should be resolved. If you encounter any further issues, make sure to check the AGP release notes for any additional requirements or changes.