首先,
我非常清楚这里已经发布了很多关于此错误的问题,但似乎没有一个有适当的解决方案,尤其是我需要的解决方案。
我被以下错误困扰了一个多星期。
我正在开发一个使用 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)