-1

I have spent a lot of hours in this. I have created two library projects lets say A and B. Project B has dependency over A, so I used A as aar in library project B.

Now I have created an android application which has dependency over library project B. I have added aar file for project B in my application. So far I am able to access files created in B project from my android application but I am unable to access files of A project.

I guess B comprises of files defined by itself and A project( let me know if I am wrong). Now I have to use A and B project's aar in my application which I don't think is good because B is already using A. Can anybody suggest how to build a library project which depends on other project's aar file so as to access files from both the projects?

I am sorry If I am unable to explain what it is?

tenten
  • 1,276
  • 2
  • 26
  • 54
Shrey
  • 248
  • 3
  • 14

2 Answers2

3

Follow these steps Very easy to add arr file in android studio.

Step A:

enter image description here

Step B:

enter image description here

Step C:

enter image description here

Step D:

enter image description here

Step E:

enter image description here

Step F:

enter image description here

Step G:

enter image description here

You are Done.

Sohail Zahid
  • 8,099
  • 2
  • 25
  • 41
1

Follow the steps:

  • Extract the aar
  • In the extracted folder you have classes.jar
  • Place the jar file in the libs folder of your Project B & add to build path
  • Mark your Project B as library (in the properties -> Android scroll to bottom and check the checkbox)
  • Add your Project B as library to main project
Logic
  • 2,230
  • 2
  • 24
  • 41
  • Do you have any idea about how to do this in android studio, I am able to import aar files and reference it. – Shrey Jun 10 '15 at 06:51
  • I tried it in eclipse long ago to implement cardview as only aar was available at that time but haven't implemented in android studio – Logic Jun 10 '15 at 09:23