Search code examples
androidgradleandroid-gradle-pluginbuild.gradleproject-structure

How can I create Android module library inside Android module library


I try to create module which is controller for XXX sdk module. So I create new module library (controller) and want to add sub module XXX sdk module. Can you give some advises how to do this?


Solution

  • Use 2 library modules. Something like:

    root
    |--libA
    |----build.gradle
    |--libB
    |----build.gradle
    |--build.gradle
    |--settings.gradle
    

    In settings.gradle:

    include ':libA' , ':libB'
    

    In libA/build.gradle:

    apply plugin: 'com.android.library'
    
    //
    

    In libB/build.gradle:

    apply plugin: 'com.android.library'
    
    dependencies {
        compile project(':libA')
    }