I have a subclass of the application that I am compatible with HasDispatchingActivityInjector, but when I try to start my application, it will break, saying:
Unable to start activity ComponentInfo{com.test.testing/com.test.testing.ui.main.MainActivity}: java.lang.RuntimeException: android.app.Application does not implement dagger.android.HasDispatchingActivityInjector
This is a subclass of the application:
class MyApplication : Application(), HasDispatchingActivityInjector { @Inject lateinit var dispatchingAndroidInjector: DispatchingAndroidInjector<Activity> override fun onCreate() { super.onCreate() DaggerAppComponent.create().inject(this) } override fun activityInjector(): DispatchingAndroidInjector<Activity> { return dispatchingAndroidInjector }
Has anyone else experienced this error before?
thanks
source share