解决 A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution > java.lang

问题描述

将Android项目的compileSdkVersion提升到31后编译报以下错误

A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution    > java.lang.reflect.InvocationTargetException (no error message)

 java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.SharedNameTable$NameImpl)

解决方法

将Gradle JDK设置到版本11即可解决

解决 A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution > java.lang_第1张图片

 

你可能感兴趣的:(android,kotlin,java,android,studio)