我在读取 dagger2 编译错误时遇到问题。例如,我有一个 NotNull 注释,我没有在 build.gradle 中为其提供正确的依赖项,但是 dagger 没有给出编译错误的实际原因,但只显示有问题的文件:
error: [ComponentProcessor:MiscError] dagger.inter nal.codegen.ComponentProcessor was unable to process this class because not all of its dependencies could be resolved. Check for compila tion errors or a circular dependency with generated code.
最后的错误来自 kapt:
A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction java.lang.reflect.InvocationTargetException (no error message)
我总是能够以某种方式追踪问题的原因,但这非常令人沮丧。 NotNull 的上述问题通常会以编译错误结束,但由于 dagger 在编译之前运行,所以我没有机会看到此错误。
是否有一些选项可以让 dagger 变得更加冗长并出现错误?我将升降机错误限制为 2500,但仍然没有出现更好的错误。
我目前使用 AGP 7.0.1 和 dagger2 2.38.1 版本
最佳答案
关于android - 缺少 dagger2 编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68942769/