突然间我开始收到这个错误,我不知道为什么如果有人让我知道这个错误在哪里,就会有足够的帮助。由于android studio的新更新,我能得到的最多。我得到的错误的详细摘要。
Task :app:kaptDebugKotlin
ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7.1ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7.1C:\Users\shubh\Downloads\MarginCalculator\app\build\generated\source\kapt\debug\com\kotlin_developer\margincalculator\DataBinderMapperImpl.java:10: error: cannot find symbol
import com.kotlin_developer.margincalculator.databinding.FragmentCalculatorScreenBindingImpl;
symbol: class FragmentCalculatorScreenBindingImpl
Task :app:kaptDebugKotlin FAILED
location: package com.kotlin_developer.margincalculator.databinding …Run Code Online (Sandbox Code Playgroud) 首先,
我非常清楚这里已经发布了很多关于此错误的问题,但似乎没有一个有适当的解决方案,尤其是我需要的解决方案。
我被以下错误困扰了一个多星期。
我正在开发一个使用 Kotlin、MVVM、Clean Arch 和导航组件构建的 android 项目。
我最近添加了领域数据库,为此我不得不添加以下插件。
apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android'
Run Code Online (Sandbox Code Playgroud)
我认为真正的问题是从这里开始的。
(之后我添加了一个 DatabaseManager 类,它使用了我编写的一些领域扩展函数来进行数据库操作。)
在此之后编译项目时,整体出现以下错误。
A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
Run Code Online (Sandbox Code Playgroud)
连同以下
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan …Run Code Online (Sandbox Code Playgroud)