How to use local aar dependency?

cs x picture cs x · Mar 5, 2015 · Viewed 21.9k times · Source

i google about local aar,every one say it can work,but it don't work at android studio 1.1.0.

i try to use :

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

but it tip:

Warning:Project app: Only Jar-type local dependencies are supported. Cannot handle: /Users/kycq/AndroidStudioProjects/QingTaJiao/app/libs/KycqBasic-release.aar

how should i do to use local aar? if i should use:

compile 'com.example.library:library:1.0.0@aar'

how to do this?

Answer

Sandy D. picture Sandy D. · May 13, 2015

I was getting the same errors.

This was the only thing that helped me:

dependencies {
   compile(name:'nameOfYourAARFileWithoutExtension', ext:'aar')
 }
repositories{
      flatDir{
              dirs 'libs'
       }
 }

Reference: Adding local .aar files to Gradle build using "flatDirs" is not working