0

I generated two aar files from two libraries generated by me and added them to my main project by putting them in the libs folder. Now I can able to access classes of the aar from the main project. But I want to call the class of the first aar from second. Is it possible?

Sweta Jain
  • 3,248
  • 6
  • 30
  • 50

1 Answers1

0

The second aar would need the first aar as a dependency. You can get away with the first aar being compileOnly with the second aar, because the main project can provide the actual library.

I noticed one of the tags you have is modularization. This kind of relationship between the 2 libraries is not modularization but tightly coupled they might as well be the same library.

What you need to do is rethink your 2 libraries and how they are supposed to interact with the outside world.

If library 1 produces an output pass it to library 2, instead of library 2 retrieving it, itself.

Your main app is the glue.

avalerio
  • 2,072
  • 1
  • 12
  • 11