2

How to add AAR library in Android Studio 1.0.2? I search about this and I found a posts, where saying that I need to put library file into libs folder. But it doesn't work. This library is for internal use and never published in open access. File build.gradle contains this line:

compile fileTree(dir: 'libs', include: ['*.aar', '*.jar'])

But Studio can't find resources from library. I've try to add it manually:

compile(name:'somelib-1.32', ext:'aar')

And when I get this error:

"Error:Failed to find: :somelib-1.32:"

How to fix it?

Hugo Gresse
  • 17,195
  • 9
  • 77
  • 119
BArtWell
  • 4,176
  • 10
  • 63
  • 106

1 Answers1

2

The build System didn't manage very well the -, as for res files.

Replace it by _ or CamelCase, so somelib-1.32.aar become somelib_1.32.aar

EDIT : Also don't forget to add flatDirs[...] to your project build.gradle

allprojects {
    repositories {
        jcenter()
        flatDir {
            dirs 'libs'
        }
    }
}
Hugo Gresse
  • 17,195
  • 9
  • 77
  • 119