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?

1
  • You mean you have 2 libs assuming A and B, you wanna call B's methods from A? Commented Jan 6, 2022 at 2:12

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.