项目引入“kapt”后 debug run报错:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
报错信息:
> Task :app:kaptDebugKotlin FAILED
Annotation processors discovery from compile classpath is deprecated.
Set 'kapt.includeCompileClasspath = false' to disable discovery.
Run the build with '--info' for more details.
ANTLR Tool version 4.7.1 used for code generation does not match the current runtime version 4.5.3ANTLR Runtime version 4.7.1 used for parser compilation does not match the current runtime version 4.5.3
FAILURE: Build failed with an exception.
解决方式:
android {
//避免编译不能用于在编译类路径中发现的注解处理器,因为它们中的任何更改都需要运行注解处理任务
kapt.includeCompileClasspath = false
}