Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update ASM to 9.6 to support newer Java versions
Update ASM from 9.0 to 9.6, the latest version. According to https://asm.ow2.io/versions.html, this version should work with Java up to 22. For testing, I tried a sample project using Gradle's `jvmToolchain`: ``` kotlin { jvmToolchain(20) } ``` And installed different versions of OpenJDK separately. It works with OpenJDK 19 and 20.0.2, but not 21.0.1, the latest stable version (https://jdk.java.net/archive/). Here's the error message: ``` * What went wrong: Execution failed for task ':app:compileDebugJavaWithJavac'. > Could not resolve all files for configuration ':app:androidJdkImage'. > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}. > Execution failed for JdkImageTransform: /usr/local/google/home/kuanyingchou/Android/Sdk/platforms/android-34/core-for-system-modules.jar. > Error while executing process /usr/local/google/home/kuanyingchou/downloads/jdk-21.0.1/bin/jlink with arguments {--module-path /usr/local/google/home/kuanyingchou/.gradle/caches/transforms-3/b52ba5074efe1b01da421b426c4b2680/transformed/output/temp/jmod --add-modules java.base --output /usr/local/google/home/kuanyingchou/.gradle/caches/transforms-3/b52ba5074efe1b01da421b426c4b2680/transformed/output/jdkImage --disable-plugin system-modules} ``` It could be that AGP doesn't yet support JDK 21. From Gradle's release note (https://docs.gradle.org/8.4/release-notes.html), it seems that Kotiln doesn't support JDK 21 either: ``` Currently, you cannot run Gradle on Java 21 because Kotlin lacks support for JDK 21. However, support for running Gradle with Java 21 is expected in future versions. ``` So the highest JDK version Hilt Gradle Plugin supports after this CL should be 20. RELNOTES=N/A PiperOrigin-RevId: 584641218
- Loading branch information