I try to add a local .aar
file to the project as it is described here, because I don't want to implement this routine each time when I change my library code.
So in my project build.gradle
file I added:
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}
Both my library and my app have two flavours - alphaTest
and myRelease
. I want each library to be added strictly to the corresponding flavour of the app.
And in build.gradle
of my app I have the following dependencies
block:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar', '**/*.aar'])
compile 'com.android.support:appcompat-v7:23.0.0'
alphaTestCompile files ('libs/myLib-alphaTest-release.aar')
myReleaseCompile files('libs/myLib-myRelease-release.aar')
}
Unfortunately as a result I always receive this kind of error:
Error:Project myApp: Only Jar-type local dependencies are supported. Cannot handle: C:\Users\...\myApp\libs\myLib-myRelease-release.aar
I tryed to use this format
alphaTestCompile ('my.package:libs/myLib-alphaTest-release:0.1@aar')
and also this
alphaTestCompile (name:'myLib-alphaTest-release', ext:'aar')
but in this case the gradle cannot event resolve the files.
How can I make .aar
files also be compiled?