Packing run time dependecies into aar library

gradle-core

#1

I build an Android Application which contains a module as library. Most of the logic is inside the LibraryModule. The library module has several other dependencies which are included as gradle dependencies

`Application

  • LibraryModule
    *implementation (‘dependency1’)
    *implementation (‘dependency2’)`

The library module is include in the application’s build.gradle like

implementation project(":LibraryModule")

The application works fine then.

But when I first build the Library module as an aar file using

gradle :LibraryModule:assemble

and then using the applications build.gradle to include the aar

implementation(':LibraryModule@aar') The application compiles. But several of the classes of the dependencies (dependency1, dependency2) which are required at run time are missing from the aar.

Is there some way to include all the contents of the dependency1 and dependency2 in the aar file so that run time dependecies is also packed together in the aar file.

I have done some googling and found out that fat aar is an option. Is there some way to include all the class file from the dependeices also into the aar file which are also needed at run time ?