失败:构建失败并出现异常。, kaptGenerateStubsDebugKotlin

NoK*_*Key 6 android android-studio

我收到以下错误,并且我一直在寻找答案几个小时:

> Task :entities:bundleLibCompileToJarDebug

> Task :app:kaptGenerateStubsDebugKotlin FAILED
e: Could not load module <Error module>

> Task :app:mergeLibDexDebug

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:kaptGenerateStubsDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details
Run Code Online (Sandbox Code Playgroud)

突然出现这个错误。我尝试了以下操作:

  1. 删除了 .idea 目录
  2. 重新启动我的电脑
  3. 删除所有gradle缓存
  4. 重建项目

错误依然存在。还有其他建议吗?

arg*_*iwi 0

TL;博士; 对于从 AGP 7.x 升级到 AGP 8.x 后遇到此问题的人,我发现恢复到 AGP 7.x 会提供更有意义的编译时错误。

将 Android Studio 升级到 Flamingo 和 AGP 8.0 后,我遇到了同样的问题。我尝试在我的项目中引入一个名为 kotlin-result 的函数式编程新库,并进行了一些重构,然后......

Task :[SOME OF MY MODULES]:kaptGenerateStubsDebugKotlin FAILED
e: Could not load module <Error module>
Run Code Online (Sandbox Code Playgroud)

在遇到多个死胡同几个小时后,我决定将升级前的更改应用到分支上,然后我发现编译器只是吞掉了很多具体错误。