score:1

Accepted answer

is the property that hasn't been initialized happening in the app class? if so, this likely means that you're missing the following in the oncreate method of the app class.

daggerappcomponent
            .factory()
            .create(this)
            .inject(this)

score:2

in your application class you define an @inject property, but you don't initialize it anywhere. what you need to do is: first declare app as the entry point for dagger-android purposes:

interface appcomponent : androidinjector<app> {

    @component.factory
    interface factory {
        fun create(@bindsinstance application: app): appcomponent
    }

    fun inject(app: app) // let dagger know your application class with root dispatching injector
}

and then actually create the appcomponent instance and use it to bootstrap dagger and inject dispatchingandroidinjector instance:

override fun oncreate() {
  super.oncreate()
  this.application = this

  daggerappcomponent.factory().create(this).inject(this)
}

Related Query

More Query from same tag