Include / libs / folder in aar

Feel me losing my mind here - it should be so easy!

I have an android aar that I created from gradle assembleReleaseas well as using a plugin maven-publish. I thought / libs / was turned on by default, but obviously not.

Android Tool Website Shows Optional Option

http://tools.android.com/tech-docs/new-build-system/aar-format

but for life I donโ€™t see where it is set up.

I asked to link the Include folder in the Gradle Q artifact , but I do not see this as a duplicate as a general Gradle issue, while it is aar specific and can be solved outside of gradle.

Edit I also asked at the Gradle forum

+2
source share
2 answers

In aar, local library packages are in libs/, so you need local jar dependencies.

dependencies {
  compile fileTree(include: ['*.jar'], dir: 'libs')
}
+5
source

When the plugin mavenlaunches uploadArchives, then it will create a file pomthat tells mavenor gradlewhat dependencies you need aar. Gradle handles the loading of files jarand puts them in its path to the class to build.

I also commented on your other question

* link: https://maven.apache.org/pom.html#Dependencies

* = gradle is supported by maven for dependency management, so artifacts available for maven are also available for Gradle and vice versa

+1
source

Source: https://habr.com/ru/post/1612726/


All Articles