You do not need to have one component, there are various ways to modulate them, but each created object or input of values ββmust have all the values ββprovided by one component.
One way to restructure the code is to have a ComponentY component in a ComponentX component, or vice versa, for example.
@Component(dependencies = ComponentX.class) interface ComponentY { void inject(MainActivity activity); }
Or you could create a third component, for example ComponentZ, if ComponentX and ComponentY are completely orthogonal to each other.
@Component(dependencies = {ComponentX.class, ComponentY.class}) interface ComponentZ { void inject(MainActivity activity); }
Or you can just reuse modules, for example.
@Component(modules = {ModuleA.class, ModuleB.class}) interface ComponentZ { void inject(MainActivity activity); }
How exactly you decide to break it up depends a lot on the structure of your code. If components X and Y are visible, but the modules then do not use component dependencies, since they (and modular dependencies) are actually parts of the component implementation. Otherwise, if the modules are visible, simply reuse them again.
I would not use areas for this, since they are really intended for managing objects with different lifetimes, for example. objects associated with a specific user whose service life is the time from which the user logs in when logging out of the system, or the service life of a particular request. If they have different lifespan, you are looking at using areas and subcomponents.