执行 org.jetbrains.kotlin.gradle.internal.KaptExecution 时发生故障

新手上路,请多包涵

突然间我开始收到这个错误,我不明白为什么如果有人让我知道这个错误在哪里,就会有足够的帮助。由于 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
    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 to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s
29 actionable tasks: 27 executed, 2 up-to-date

原文由 Shubham Tater 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 836
1 个回答

这个答案对于那些在同一台机器上从一个帐户(用户)切换到另一个用户(WINDOWS 操作系统)的人很有用

我遇到了类似的问题

failure occurred while executing org.jetbrains.kotlin.gradle.internal.kaptwithoutkotlinctask

但原因是以下文件的权限被拒绝

C:\Android\.gradle\caches\modules-2\files-2.1\com.android.tools.build.jetifier\jetifier-core\1.0.0-beta09\c98ee0e5579aed97e17f605a89b101115a2f5a61\jetifier-core-1.0.0-beta09.jar

问题场景

我所做的是,将 C:\Android.gradle\ 从我以前的机器复制到新机器。我在新机器上使用的用户帐户是 X。我创建了一个新帐户,然后删除了帐户 X。

由于 X 是所有者,因此新帐户存在权限问题。

解决方案是更改所有权或删除 C:\Android.gradle\ 并让 Android Studio(AS) 下载相同的内容。出于同样的原因,我在提交时也面临所有权问题。为了避免任何进一步的问题,我删除 C:\Android (其中包括 .gradle, .android, C:\Android\Local\Android\Sdk 文件夹)重新安装了 Android Studio。

git 子模块更新失败,出现“致命:在存储库中检测到可疑所有权”

原文由 tanni tanna 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题