简体   繁体   中英

Is there any way to access methods of one aar file from another aar file in project libs folder

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM