我正在使用Android Dagger2,但是我得到了类似的错误。error: [dagger.android.AndroidInjector.inject(T)] android.app.Application cannot be provided withoutan @Inject constructor or from an @Provides-annotated method.
android.app.Application is injected atAppModule中的provideCont
我想直接将点击的项目id传递给详细的演示者。我的详细活动有一个公共财产,所以我试图提供给我的推荐人。这是我的密码;public class MovieDetailActivityModule {
Long provideMovieId(MovieDetailActivitymovieDetailActivity) { }
我正在使用Dagger 2,但得到了这个奇怪的错误,到目前为止对我来说似乎没有什么不好的,但显然缺少一些东西。任何帮助都将不胜感激。cannot be provided without an @Inject constructor or from an @Provides-annotated method.代码如下:@Module(includes = ViewModelModule.class) @Singleton
@
我一直在尝试实现Dagger2。问题:当我使用构造函数注入时,它工作得很好,但是当我使用字段注入时,它会抛出一个错误,如下所示:
Error:(6, 48) error: cannot find symbol class DaggerApplicationComponentDagger2 --我的理解是:您必须创建一个模块类,您将在其中创建方法。这些方法将为您提供所需类的相应对象,如Retrofit、ApplicationContex