Search code examples
androidintellij-ideaandroid-library

How to convert IntelliJ android app project into android library project?


I have an android app project that has code, assets, and layouts, that I'd like to make available in other apps.

The app project is in IntelliJ IDEA.

Question 1) How do I convert this project into an android library project?

Question 2) After converting, how do I import the library project into other app projects in IntelliJ?


Solution

  • Hi Evelyn check the docs:

    Sharing Android Source Code and Resources Using Library Projects

    Converting an Application module into a Library module

    You can convert an Application module into a Library module by updating its Android facet.

    1. Open the Project Structure dialog box by choosing File | Project Structure from the main menu.
    2. Select Modules in the left pane. In the central pane, expand the node of the module that you want to turn into a Library module and click Android.
    3. In the right-hand pane, select the Library module check box on top of the Android facet page.