Note
With the release of Android Studio 0.5.0, this answer is deprecated, but I will leave it below for reference. For more detailed instructions, see How to split a single library source across multiple projects.
In Android Studio, it is difficult to have projects with a common library, because at present it is a limitation that all modules in the project must live in the same root folder; it seems that you learned about this when you tried to solve your problem by making one large project that includes everything. We are working on an attempt to remove this restriction.
The best answer right now is to make library modules separate projects and publish them to your local Maven repository, and so that dependent projects get them out of this repo. This means that, unfortunately, you cannot work with the sources of your application + library module from the context of one project. The biggest drawback is that the source attachments for these library modules do not work yet, so if you are trying to debug your application, it will be difficult for you to enter the code in the libraries.
I know this is not a very good answer, but at this stage in the evolution of Android Studio, this is probably the best we can do. We know that yours is a fairly common precedent, and for us this is a priority.
Scott Barta Feb 06 '14 at 17:08 2014-02-06 17:08
source share