Dagger 2: Provide same instance between multiple Component with same Scope on different library modules
I have a Core Android Library where I'm defining a CoreComponent ad using the @Singleton scope to inject instances of classes provided by a CoreModule. @Singleton @Component(modules = {CoreModule.class}) public interface CoreComponent { void inject(SomeClass target); } @Module public class CoreModule { @Singleton @Provides CoreRepository provideCoreRepository() { return new CoreRepositoryImpl(); } } I would like to access the same @Singleton instances from another Android Library that is depending on the Core Library and is using another component. @Singleton @FooScope @Component(modules =