Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

675
Vistas
kaptGenerateStubsDebugKotlin fails on a Apple M1 Macbook (JDK 11)

I get this failure both in Android Studio and running ./gradlew assembleDebug on the command line on a new Macbook with Apple M1 Max chip. On my old Intel Mac there are no problems building the project.

> Task :app:kaptGenerateStubsDebugKotlin FAILED
e: java.lang.IllegalAccessError: class org.jetbrains.kotlin.kapt3.base.KaptContext (in unnamed module @0x4d1ecff7) 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 @0x4d1ecff7
        at org.jetbrains.kotlin.kapt3.base.KaptContext.<init>(KaptContext.kt:28)
        at org.jetbrains.kotlin.kapt3.KaptContextForStubGeneration.<init>(KaptContextForStubGeneration.kt:40)
        at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.contextForStubGeneration(Kapt3Extension.kt:287)
        at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:171)
        at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:102)

(Here's the full error output)

class org.jetbrains.kotlin.kapt3.base.KaptContext (in unnamed module @0x4d1ecff7) 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 @0x4d1ecff7

Googling around, the error message looks a lot like the one here: "Kapt is not compatible with JDK 16+". But thing is, I'm using JDK 11. (Same result on both Android Studio's default JDK (11.0.10) and "11.0.13 2021-10-19 LTS" downloaded from www.oracle.com.)

Any ideas how to get this working on the M1 Mac?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

From the link mcomella has shared - https://youtrack.jetbrains.com/issue/KT-45545, they have fixed it in Kotlin 1.6.x.

So bumping to Kotlin 1.6.x has worked for my case (Apple M1 Pro).

over 4 years ago · Santiago Trujillo Denunciar

0

I solve it in my MacBook Air M1 updating the Kotlin version and all other library for the last version, you have to update the compileSDKVersion and targetSDKVersion for the latest version as well.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda