Please add support for MultiDexApplication in DaggerApplication. This would only require extending from MultiDexApplication instead of Application. Or is there a good way to use this that I'm not aware of?
You can copy the implementation of DaggerApplication directly into your Application subclass. It's only a few lines.
Thanks for your response. I hope I'm correct in assuming that a) the implementation for DaggerApplication is not likely to change and b) you (edit: or whoever calls the shots) are not going to consider supporting MultiDexApplication?
I don't speak for the Dagger team, but the documentation indicates that these base classes are merely provided as a convenience around the supported mechanism and instructions for doing it yourself:
Because
DispatchingAndroidInjectorlooks up the appropriateAndroidInjector.Factoryby the class at runtime, a base class can implementHasActivityInjector/HasFragmentInjector/etc as well as callAndroidInjection.inject(). All each subclass needs to do is bind a corresponding @Subcomponent. Dagger provides a few base types that do this
@JakeWharton is right, but what is likely to be even smaller (and even less likely to change) is to keep the DaggerApplication base class and copy the contents of the MultidexApplication implementation. This is a documented approach by the MultidexApplication docs
Wow that's tiny!
On Wed, Jan 17, 2018 at 10:26 AM Ron Shapiro notifications@github.com
wrote:
Closed #1035 https://github.com/google/dagger/issues/1035.
—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/google/dagger/issues/1035#event-1428496743, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAEEEQx4oPmo66xQOODeQKSTyDQiNdlOks5tLhEhgaJpZM4RhdFS
.
the links you pasted are now blank. Can you check em out please @ronshapiro
@Ezike from docs if you don't have the option to extend MultidexApplication you can do this
class MyApplication : SomeOtherApplication() {
override fun attachBaseContext(base: Context) {
super.attachBaseContext(base)
MultiDex.install(this)
}
}
Most helpful comment
@JakeWharton is right, but what is likely to be even smaller (and even less likely to change) is to keep the
DaggerApplicationbase class and copy the contents of theMultidexApplicationimplementation. This is a documented approach by theMultidexApplicationdocs