Import local aar library

Usually dependency libraries are referred through build.gradle (app) with the web address, but you can also import a local library.

dependencies { compile ''
               compile ''
               compile ''

Reference a local library jar/aar through:

File > New > New Module

After the new module window, comes create new module window with File name and Subproject name.

First is the location of aar file and the second one is the subproject name, which you can select yourself, it is used for local reference.  In this example we will call it imported-aar. There will appear a new build.gradle (Module: imported-aar) in the android project explorer. We can reference it in build.gradle (app) as follows.

dependencies {  compile ''
                compile ''
                compile ''
                compile project (':imported-aar')

Then you need to use Sync Now in the upper right corner of build.gradle (app).


Inside the aar libraries are just zip folders with certain structure: Android Tools: Aar Format


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s