I have project structure like
app :
InstantApp :
library:
dynamic-feature1 :
dynamic-feature2 :
dynamic-feature3 :
Now there is some dependency between dynamic-feature1 and dynamic-feature2. Now if i add it as dependency in dynamic-feature2 build.gradle then it will cause cyclic dependency. Above is just one example there are many other cases too. How to handle such dependency conflicts properly or any suggestion ?
Communicate from the main app module to a dynamic feature module
You can do this by reflection in Java. Make sure your class and method names are not obfuscated in the dynamic modules.Get a Fragment/Activity or other class from module:
Get a method from your class:
Invoke the method:
Communicate from dynamic feature module to main module
To get a parent activity of a dynamic feature module's fragment you can do:
Then you can call a method on that activity.