android-gradle How to add .aar dependency in a module?


Example

In a module (library or application) where you need the aar file you have to add in your build.gradle the repository:

repositories {
    flatDir {
        dirs 'libs'
    }
}

and add the dependency:

dependencies {
    compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar')
}

Pay attention to the relative path of the libs folder that you are using in the module.