Error text
Unsupported class file major version 65 Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
Unsupported class file major version 65 Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
Gradle or the Android Gradle Plugin needs a different JDK. The class file is newer than the Java that runs it, or the other way round.
java -version and ./gradlew --version to see which Java is used.Settings > Build > Gradle > Gradle JDK to 17.JAVA_HOME at the JDK 17 folder.jvmToolchain(17) in the project so everyone gets the same Java../gradlew --stop, then build again.java -version
./gradlew --version
# gradle.properties
org.gradle.java.home=/usr/lib/jvm/java-17-openjdk-amd64
# app/build.gradle.kts
compileOptions { sourceCompatibility = JavaVersion.VERSION_17; targetCompatibility = JavaVersion.VERSION_17 }
kotlin { jvmToolchain(17) }Write the JDK version in the README and in jvmToolchain, in one place.
Author and license: Nibras Code