For various reasons, I am in a situation where I have several application components that exist in small isolated projects of the android library that compile as .aar
s.
In some cases, they are pushed into the maven repo and consumed in a way that is good and everything works fine.
In other cases, these ares should be compiled into another android library . With my current Im configuration having problems as the contents of child aar lib are not added to the parent aar lib project on gradlew assembleRelease
.
Dependency flow is similar to
Apk app project -> parentLibProject -*> childLibProject
This causes the parent aar to compile fine, since the child aars are in the classpath, but will not include the contents of the child aar libs in the parent aar . This means that any android application project that uses the parent lib will fail at compile time, since the files / codes of the child libar are not in the parent arrangement. I don’t want to go along the path forcing the application project to manually list all the projects of the child libs that were already specified in the parent lib project. In essence, I want them to be treated similarly to jar
libs that are used by the library project, that is, compiled into an output file aar
.
I tried several unsuccessful approaches (which all build fine , but all cannot output the child contents of aar lib to the parent aar lib file ):
- A compiled child
aar
inside /libs/
, which is declared in repository closure using flatDir { dirs 'libs' }
and imported into the source lib project with compile(name:'someAarLib-x.y.z', ext:'aar')
. This compiles fine, but the parent project must also include someAarLib-x.y.z
aar and compile(name:'someAarLib-x.y.z', ext:'aar')
. - Import a daughter board in the form of modules described in this answer qaru.site/questions/45044 / ... . This compiles fine, but has the same problem as 1.
- , qaru.site/questions/1612726/...,
*.aar
. ( SO)
Gradle 2.3 android 1.2.1 .
classes.jar
aar lib ( qaru.site/questions/1612726/...), , xml, . / , . , , , , .
.