Compiling one .aar library file from multiple modules

Hello everyone I have library project that consists from multiple modules :

  • module 1
  • module 2
  • module 3
  • module 4

I want to export all four modules as one .aar library file so I'm thinking about generating .aar files for each module and including it to other .aar file I'm not sure if this is going to work or is this good practice so I want your opinions on that ? And what is the best way to compile one .aar file from multiple modules ?

stack=java.lang.NoClassDefFoundError: Failed resolution of: Ldagger/internal/Preconditions .... Caused by: java.lang.ClassNotFoundException: Didn't find class "dagger.internal.Preconditions" on path: DexPathList[[...

It's seems dependencies don't get included into .aar file.

Answers


the "standard" way of doing it is to just direct use the modules in the compilation process that will generate the 1 aar.

So let's say module1 is the main part of the library, you'll have the following on it's build.gradle

apply plugin: 'com.android.library' // it's a library, generates aar

dependencies {
    // the other modules are dependencies on this one
    compile project(':module2')
    compile project(':module3')
    compile project(':module4')
}

Need Your Help

Asterisk 11 cannot make a call after installing MySQL real-time database

mysql asterisk

I've installed Asterisk 11 on CentOS 6.4 and MySQL Database real-time. I followed this manual.

Centerize table vertically and horizontally in div

css html-table alignment vertical-alignment centering

You may think it was duplicated, but I don't thinks so, because I'm talking about tables not images!