我使用Dagger2,其中AppComponent和ActivityComponent都能生成相应的Dagger类,但是UserComponent怎么也生不成Dagger类。重新编译了无数次,清除重写,还是不行。为什么呢
@Component(modules = [UserModule::class])
interface RegisterComponent {
fun inject(activity: RegisterActivity)
}
经过不断测试发现,只能在BaseLibrary这个module中才能生成Daggercomponent 类,在其他的module中不行,是不配置的问题呢,因为对Dagger所有的依赖文件都在BaseLibrary的build.gradle中