com.hi.app.presenter.contract.AccountContract.IAccountPresenter cannot be provided without an @Provides- or @Produces-annotated method.
产生这个错误的原因之一:
@Component(modules = LoginContractModule.class)
public interface AccountActivityComponent {
void inject(AccountActivity accountActivity);
}
这里传入的modules是传错了,传入了其它的不相关的module,引起这样的编译错误,其实
DaggerAccountActivityComponent
.builder()
.accountContractModule(new AccountContractModule(this))
.build()
.inject(this);
进入编译出来的 "DaggerAccountActivityComponent" 代码里就可以大概看出来引起混乱的不相关的类。