I'm currently experimenting with InstantApps and would like to include dagger into my project.
I'm facing an issue setting up an application AppComponent. My application component includes all the feature dagger modules of my app.
I basically have:
- One Base app module containing my Application class
- Multiple features with each a dagger Module per Activity, all with Base as a dependency.
- One app module and instant module both importing all the features and the base app module.
I'm trying to figure out the setup before adding the Instant App module.
From InstantApps documentation and project examples. It seems like the Application class needs to be in Base. From the Dagger documentation, to setup dagger:
DaggerYourAppComponent.create().inject(this);
Should be included in your application class. However, this seems to be impossible as the AppComponent needs to reference all the feature dagger modules.
My questions are:
- Where should I add my AppComponent dagger module?
- Should I keep my application in the app module and not in Base?
- Any GitHub repo or documentation around Dagger with Instant Apps?
Thank you