我的android项目具有三个模块:
介绍<=域<=模型
(演示见域,域见模型,演示不见模型)
每个模块都包含Dagger的@Component类。
@Component PresentationComponent(dependencies = [DomainComponent :: class]),
@Component DomainComponent(dependencies = [ModelComponent :: class]),
@Component ModelComponent
编译失败,并带有以下堆栈跟踪:
> Task :app:kaptDebugKotlin FAILED
e: error: compiler message file broken: key=compiler.err.Processor: org.jetbrains.kotlin.kapt3.base.ProcessorWrapper@658ca377 arguments={0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}
e: error: cannot access ModelComponent
class file for com.app.core.model.ModelComponent not found
Consult the following stack trace for details.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for com.app.core.model.ModelComponent not found
有人知道如何实现这一目标吗?谢谢!
编辑: 更改后
kapt 'com.google.dagger:dagger-android-processor:2.17'
kapt 'com.google.dagger:dagger-compiler:2.17
收件人:
annotationProcessor 'com.google.dagger:dagger-android-processor:2.17'
annotationProcessor 'com.google.dagger:dagger-compiler:2.17
它可以编译,但是我很困惑为什么。