-3

i am a android app developer and converting myself from Eclipse to Android Studio.

Now i get a difficulty to add library project into another project.

What i can do in Eclipse is very clear: 1.Set project B as library Project (right click->properties->android->is Library) 2.Add this library into Project A (right click->Properties->android->add...->choose Project B->OK

But how can i execute such behavior in AS? I read article Create a standalone library with Android Studio

and Create Project A as Library in AS.

Now i create Project B in AS with module BApp, how can i add Library Project A into B/BApp?


The reason i would not like to copy files of Project A to Project B is, I would also use Library Project A in my many other Project. I dont think it is a good idea that make a hard copy to each Project while i will always update Library A in local.

Appreciation for the Help!

1 Answers1

2

You have to go to Project Structure and add the library as a new module. To do this click on the + icon and select Import Existing Project, once the module is imported go to the Dependencies tab, click on the + icon and select Module Dependency and click on your library.

Ayoub
  • 341
  • 1
  • 13
  • I did this but There is no Project A in depedencies List. The Library Project A is a standalone Project in AS, not a module in project B. The reason is i could reuse A for many other Project. – user3181371 Jul 25 '14 at 10:27
  • still you should be able to add Project A as a module of B, this will not prevent you from adding it to other projects as well – Ayoub Jul 25 '14 at 10:33