How to add AAR file or Android Library(Module) as a dependency in your project

In this tutorial,we will learn how to add AAR file  or Android Library(your module) as a dependency in your project step by step.

I assume that you have AAR file and want to add into your android studio project.

Let’s start

Step 1:

a.Click on File >New >New Module

b.Click on Import .JAR/AAR package then click Next

c.Enter the location of the compiled AAR or JAR file then click Finish

After that it will take sometimes to synchronise the gradle & module_name will show  in the project list section after the synchronisation.

Step 2:

After completing the ‘step 1’.You have to follow the instruction of step 2.

a.Go to File >Project structure

b.Under the “module” in the left menu,select “app”

c.Go to “Dependencies” tab

d.Click the ‘+’ icon in the upper right corner “Module dependency” new module from the list

g.Apply and click.

After that it will take sometimes to synchronise the gradle and have completely added the AAR file in the android studio project.

But you have to check the below condition that are satisfying or not. 

Step 3:

Make sure that your library is listed at the top of settings.gradle  like this

Include  ‘:app’, ‘:your_module_name’

Step 4:

Open the app module build.gradle  file and add below given code in dependencies block.If already added this below code ,ignore it.

Implementation project(path: ‘:your_module_name’) 

Step 5:

Click Sync project with Gradle Files

Now you have completely added the AAR file in  your project.If any error occur then you can comment me.

Now , you have to make a button in the app module section for the accessing the activity of android library.

Button button=(Button)findViewById(;

button.setOnClickListener(new View.OnClickListener)
Public void onClick(View v)
Intent intent=new Intent(CurrentActivity.this,SdkActivity.class);


1.Here,CurrentActivity is the java class of  app module class where you have make button.

2.And SdkActivity  is the  java class of android library.Here it will open the android library screen without giving the error.

3.Here sdkActivity  class will show in the app module section without giving error.

So don’t worry.

I have written this article by  my own experience and I have explained all things in a good manner Still if you are facing any  problem during the adding AAR file.

You can comment me.I will give you response very quickly.


Hello Friends,I have written and developed this website because you can learn technology easily ,prepare for the placement and also for the any type of examination . By :Suman Kumar

Leave a Reply

Your email address will not be published. Required fields are marked *