Error1: Android Studio version is not compatible with AGP
Error:com/android/tools/lint/model/LintModelSeverity has been compiled by a more recent version of the Java Runtime
Error3:project is incompatible with AGP
Error1: Android Studio version is not compatible with AGP
Solution
- Android Studio Error Message: "The project is using an incompatible version (AGP 8.1.0) of the Android Gradle Plugin. Latest supported version is AGP 7.3.0."
- This means your Android Studio or Gradle version does not fully support AGP 8.1.0, even though you are using Java 17 .
Root Cause
This error occurs because:
1.Your Gradle version or Android Studio version is not compatible with AGP 8.1.0.
2.AGP 8.1.0 requires:
- Gradle 8.0 or later
- Java 17
- Android Studio Chipmunk or later (preferably Electric Eel or later)
- Even if Java 17 is correctly set, if your Gradle version or Android Studio is older, it will still show incompatibility issues .
Steps to Resolve
- Ensure Android Studio is Updated
- Check your Android Studio version. Go to Help > About.
- AGP 8.1.0 requires Android Studio Chipmunk or later.
- If your version is outdated, update Android Studio to the latest version from the official site: Download Android Studio .
Update Gradle Version
Ensure your Gradle Wrapper supports AGP 8.1.0:Open gradle/wrapper/gradle-wrapper.properties.
Update the distributionUrl to
:
properties
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
- Sync with Gradle and Rebuild
- After updating Gradle, sync your project
Go to File > Sync Project with Gradle Files.
- Then clean and rebuild the project
Build > Clean Project, followed by Build > Rebuild Project.
- Verify build.gradle Configuration Ensure the following in your root-level build.gradle:
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.0'
}
}
- Verify Java Settings Your JAVA_HOME is correctly set to Java 17, but confirm that Android Studio is using Java 17:
- Go to File > Settings > Build, Execution, Deployment > Build Tools > Gradle.
- Ensure Gradle JDK is set to Java 17 If You Cannot Update Android Studio If updating Android Studio is not an option, downgrade AGP to the latest version supported by your setup:
Change the AGP version in your root build.gradle to 7.3.0:
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
}
Update the gradle-wrapper.properties file to use Gradle 7.5.1:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
This will work with older versions of Android Studio but requires Java 11 instead of Java 17.
Error:com/android/tools/lint/model/LintModelSeverity has been compiled by a more recent version of the Java Runtime
This error occurs because the version of Java you're using to run your project is incompatible with the version of the Android Gradle Plugin or the LintModelSeverity class. Specifically, the error indicates that the LintModelSeverity class has been compiled with Java 17 (class file version 61.0), but your current Java Runtime only supports up to Java 11 (class file version 55.0).
Here’s how you can resolve this issue
error Failed to apply plugin 'com.android.internal.application'.
> Could not create an instance of type com.android.build.gradle.internal.dsl.ApplicationExtensionImpl$AgpDecorated.
Explanation of Error
AGP Version
For older projects targeting AGP 7.x and Gradle 7.x.
For new projects targeting AGP 8.x and Gradle 8.x.
Top comments (0)