When a project loads a custom Android Lint check compiled to Java 21 bytecode, a Lint task can fail with UnsupportedClassVersionError and a reference to class file version 65.0. Google tracked this as Issue #314101896, “Android Lint fails with custom lint checks compiled to Java 21 bytecode,” and lists it as fixed in Android Gradle Plugin (AGP) 9.2.0.
Representative error log
Execution failed for task ':app:lintAnalyzeDebug'.
> A failure occurred while executing lint
java.lang.UnsupportedClassVersionError:
com/example/lint/CustomIssueRegistry has been compiled by a more
recent version of the Java Runtime (class file version 65.0)
The class and task names vary. Class-file version 65 corresponds to Java 21; a stack trace pointing into a custom IssueRegistry or Detector helps distinguish this problem.
Cause
The application classes are not usually the culprit. The failure occurs when a custom rule loaded through lintChecks or a packaged Lint JAR was compiled to Java 21 bytecode and an older Lint integration cannot load it correctly. Google’s AGP 9.2.0 release notes list Issue #314101896 under fixed Lint Integration issues.
Version scope: AGP 9.2.0 is the officially confirmed fixed release. The public release note does not identify the first affected AGP version, so it is not safe to claim that every earlier release is affected.
When it occurs
- A custom Lint module or dependency JAR is compiled to Java 21 bytecode.
- The project loads it through
lintChecksor a library’s packaged Lint JAR. - The build uses an AGP/Lint integration without the fix for Issue #314101896.
Recommended fix
- Identify the failing JAR.
./gradlew :app:lintDebug --stacktraceFind the first internal or third-party Lint class in the stack trace.
- Upgrade to AGP 9.2.0 or later. For AGP 9.2, follow the compatibility table: use Gradle 9.4.1 or newer and run Gradle on JDK 17.
- Stop old daemons and rerun Lint.
./gradlew --stop ./gradlew clean ./gradlew :app:lintDebug --stacktrace - Verify the same versions in CI. Compare
./gradlew --version, the version catalog, and plugin declarations.
Alternative when you cannot upgrade
As a compatibility workaround, rebuild and republish the custom Lint module for Java 17:
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
tasks.withType<JavaCompile>().configureEach {
options.release.set(17)
}
If the module contains Kotlin, align its JVM target with Java 17 as well. This reduces the bytecode level; the officially confirmed product fix remains AGP 9.2.0.
How to verify the fix
- Both Debug and Release Lint tasks complete.
- CI loads the same custom rules successfully.
UnsupportedClassVersionErrorandclass file version 65.0disappear from the log.- The Lint report contains findings from the custom rules, proving that they were not merely skipped.
Cautions
The JDK that runs Gradle, the application’s sourceCompatibility, and the bytecode level of the Lint rule JAR are separate settings. AGP 9.2 officially requires JDK 17, while this fix specifically addresses loading custom Lint checks compiled to Java 21. You do not need to move the entire application to Java 21.
Summary
If custom Lint fails on class file version 65.0, check for a Java 21-compiled rule JAR combined with an older Lint integration. Upgrade to AGP 9.2.0 or later. If that is temporarily impossible, rebuild the Lint module for Java 17 and verify it locally and in CI.
Official references
- Android Gradle Plugin 9.2 release notes (Issue #314101896; updated September 17, 2026)
- Google Issue Tracker #314101896
- Android Studio Panda 3 closed issues
