When configuring compileOptions, sourceCompatibility, targetCompatibility, and kotlinOptions { jvmTarget } to Java 17 in my project setup, I encounter the following exception:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformDebugClassesWithAsm'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:149)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
at
....
....
Caused by: java.lang.UnsupportedOperationException: PermittedSubclasses requires ASM9
at org.objectweb.asm.ClassVisitor.visitPermittedSubclass(ClassVisitor.java:265)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:706)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:424)
at com.android.build.gradle.internal.instrumentation.AsmInstrumentationManager.doInstrumentByteCode(AsmInstrumentationManager.kt:225)
at com.android.bui
The error “PermittedSubclasses requires ASM9” occurs for every Kotlin sealed class and enum.
My Project Configuration:
Gradle: 8.0.2
Kotlin: 1.8.10
I experimented with various combinations of Gradle and Kotlin versions, but unfortunately, none of them resolved the issue.
Any assistance on resolving this issue would be greatly appreciated.