0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Dagger/MissingBindingエラー

Posted at

以下のようなエラーが出た

エラー: [Dagger/MissingBinding] [dagger.android.AndroidInjector.inject(T)] jp.co.xxxxx.yyyy.data.repository.ZzzRepository cannot be provided without an @Provides-annotated method.
public abstract interface AppComponent extends dagger.android.AndroidInjector<jp.co.xxxxx.yyyy.App>
 ・
 ・
 ・

結論

対象repositryのBindsができていなかった。。。

@Module(includes = [DataSourceModule::class])
interface RepositoryModule {
    @Binds
    fun bindZzzRepository(repository: ZzzDataRepository): ZzzRepository
}

新たな画面を追加する際にrepositoryの追加も行う場合に、moduleに対しても色々と設定追加してやらないといけないのが漏れていた。Daggerの概念をちゃんと理解しつつ設定周りをちゃんと確認しないとですね。。

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?