0
0

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 5 years have passed since last update.

android.support.v4.app.Fragmentを使用して起こる[Dagger/MissingBinding] エラー

Last updated at Posted at 2018-08-08

#概要
これまでビルドできていたプロジェクトで特に変更を加えていないのに以下のエラーが出るようになった時の備忘録

エラー: [Dagger/MissingBinding] java.util.Map<java.lang.String,javax.inject.Provider
<dagger.android.AndroidInjector.Factory<? extends android.support.v4.app.Fragment>>>
 cannot be provided without an @Provides-annotated method.
@Singleton

#原因
詳細は不明
以下の二つのライブラリのver2.17が出たタイミングで発生した
"com.google.dagger:dagger-android"
"com.google.dagger:dagger-android-support"

要はandroid.support.v4.app.Fragment使うときはAndroidInjectionModuleではダメ

#解決
SupportLibraryを使う場合はAndroidInjectionModuleではなく
AndroidSupportInjectionModuleが必要

AppComponent.kt
@Singleton
@Component(modules = [
//    AndroidInjectionModule::class,<−SupportLibrary使わないならこっち
    AndroidSupportInjectionModule::class,
    AppModule::class,
    ActivityBuilder::class])

参考
Dagger-android application build failed #783

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?