简体   繁体   中英

why i should add dependencies that in aar file to my project?

I created the my Android Archive Library aar file that have it's own dependency in it's Gradle. I use this library in many projects of mine, but why I should add aar dependency to my application dependencies? as we know benefit of using aar vs jar is aar can have and hold it's own resources and dependencies.

The aar file doesn't contain the nested (or transitive ) dependencies and doesn't have a pom file which describes the dependencies used by the library.

It means that, if you are importing a aar file using a flatDir repo you have to specify the dependencies also in your project.

You should use a maven repository (you have to publish the library in a private or public maven repo), you will not have the same issue.
In this case, gradle downloads the dependencies using the pom file which will contains the dependencies list.

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