Android KaptExecution:Annotation processors discovery from compile classpath is deprecated

项目引入“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

}

详细文档:

使用 kapt - Kotlin 语言中文站

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 20
    评论
评论 20
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值