Getting this error while building the shadowsocks project.
(https://github.com/shadowsocks/shadowsocks-android)
java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.base.KaptContext (in unnamed module @0x1d312b6c) cannot access class com.sun.tools.javac.util.Context (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.util to unnamed module @0x1d312b6c at org.jetbrains.kotlin.kapt3.base.KaptContext.(KaptContext.kt:28)
I encountered this problem when running an old app. My original kotlin version was 1.3.72 and i updated it to 1.8.21 and my problem was solved.
In my situation, the issue was that the Gradle file defined VERSION_17, but the Gradle JDK was chosen as JDK 21; as a result, I was having trouble, so I changed the JDK version to 17. Make sure both versions are same.


If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With