Im working on an Android App, currently using DSL and some libraries, suddenly the build gave me this error.

Task :app:kaptDebugKotlin FAILED 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.

出了什么问题:

Execution failed for task ':app:kaptDebugKotlin'. A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution java.lang.reflect.InvocationTargetException (no error message)

我一直在寻找,但没有成功...

如果你想看到这个问题,你可以克隆这个项目.Project GITHUB

推荐答案

因此,解决方案来自构建.格拉德尔

基本上,从房间里传来的信息是这样的

import(Room.compiler)

so i changed to this, and the issue was solved :)

kapt(Room.compiler)

Kotlin相关问答推荐

只能在元素区域中点击的Jetpack Compose列

Spring Boot Bean验证器未触发

KMP:未能添加cafe.adriel.voyager依赖项

访问者闭包中的Kotlin序列yield 率

列表在 android WebView 中没有正确迭代

找不到有效的 Docker 环境

如何在 Spring Boot 3 中为内部类提供运行时提示

具有泛型类型的 Kotlin 密封接口不会为其子类型推断约束

测试协程和线程之间的差异,我在kotlin中使用线程时无法得到OOM错误

is return inside function definition 也是 kotlin 中的表达式

Kotlin:查找集合中最常见的元素

Spring webflux bean验证不起作用

如何在 Kotlin 中判断数组类型(不是泛型类型)

取消信号上的kotlin流量采集

编译错误:-Xcoroutines has no effect: coroutines are enabled anyway in 1.3 and beyond

Kotlin协程无法处理异常

kotlin 委托有什么用?

Lint 错误:可疑的相等判断:在 Object DiffUtilEquals 中未实现 equals()

java.lang.NoClassDefFoundError:解析失败:Lkotlin/time/MonoClock

可见性不适用于 Kotlin