2

In Eclipse it is possible to add a library project as a dependency to your Android project but maintain the library project and Android project in separate git repositories.

The idea is that you might have a library project that is constantly being built up with new features by a number of programmers and stored in its own repository. If I were to add this library project to a new Android Studio project I won't be able to update the library project with the latest changes because Android Studio makes a copy of the library project and places it into your Android project.

There must be some way to maintain the Android project and the library project separately in Android Studio. Has anyone managed to do this?

Wouter
  • 291
  • 4
  • 12

2 Answers2

0

You can add your library project as a module depencency, so it will be synced automatically. First you need to import the library as a new module into your project:

File > Import module > select your library source folder

Then you add this module as a project dependency:

File > Project Structure > Modules > select your project module > Dependencies > + > Module Dependency > select your library module .

Darek Kay
  • 15,827
  • 7
  • 64
  • 61
  • Hi Darek. Thanks for your reply. I tried your recommendation but it doesn't seem to work. I added the library as a module as you instructed, but when I made changes to the library outside of my project I did not see it syncing in anyway. Are you sure this is all you need to do? Is there some other step I need to do to get the library code to sync? – Wouter Mar 13 '15 at 14:02
0

you can by adding the library from git as a submodule to your application project. i have explained the steps in here : Android Studio, how to add my own git repository as a library project(sub module)?

Community
  • 1
  • 1
Deepak PK
  • 59
  • 6