首先,
I'm pretty much aware that a lot of questions on this error had been posted already here, and none of them seems to be having a proper solution especially the one I need.
我被以下错误困扰了一个多星期.
我正在做一个android项目,它正在使用Kotlin、MVVM、Clean Arch和导航组件构建.
我最近添加了realm数据库,为此我必须添加以下插件.
apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android'
我想真正的问题是从这里开始的.
(After that I added a DatabaseManager class which makes use of some realm extension functions I wrote to make db operations.)
当我在此之后编译项目时,总体上发生了以下错误.
A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
以及以下内容
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 7s
30 actionable tasks: 6 executed, 24 up-to-date
它指向我的MainActivity类,该类没有改变,似乎没有任何错误或打字错误.I'm pretty much sure that the kapt annotation processor does some dirty job here that I do not seem to figure out.个
I will be greatly relieved if I could get past this weird error.
其他注意事项:
-
我将整个项目分为三个模块.三个都有kapt插件(以防万一)
-
I use Koin for DI
Hope someone will help me out!