I have an Android project in gradle where I want to use a library packaged in an aar file. After some research I found the easiest way to consume it is by adding a flatDir repository to your build.gradle file.

1
2
3
4
5
repositories {
  flatDir {
    dirs 'libs'
  }
}

You probably already have a repositories section in your build.gradle file so you will only need to add the flatDir section. Also, make sure that you are adding it as a top level. The first time I tried I was adding it to the repositories section inside of buildscript and it was not working.

After specifying the repository you need to add your aar file inside the libs directory and reference it from the dependencies section inside build.gradle (also make sure it is top level):

1
2
3
dependencies {
  compile 'com.ncona.conversiongraph:conversion-graph:1.0@aar'
}

Now you can use your library within your app.

[ mobile  android  productivity  dependency_management  automation  ]
Managing Kubernetes Objects With Yaml Configurations
Introduction to Bazel
Monetizing a Jekyll blog with Adsense
Introduction to Simple Workflow Service (SWF)
Introduction to CloudFormation