Project Management IntelliJ IDEA / Android Studio

I'm just moving on to Android Studio, and I'm a little confused about how to manage my projects / modules.

For example, in Eclipse I would have 3 projects:

  • Library project (has several jar libraries)
  • Application 1 project (uses the library project, as well as some other jar libraries)
  • Application 2 project (also uses the library project, as well as some other jar libraries, does not use the application 1 project)

So, if I understood correctly, I would create 2 projects in Android Studio, one for AP1, one for AP2, and in both projects I would add a library project as a module?

When I do this, I suddenly get two Facets in the Library module called Android and Android2 . What does it mean?

In addition, if I go a little more and add several libraries as modules, I get (on the "Libraries" tab in the project settings) several libraries, libs , libs1 , libs2 . They may contain double cans, which AS complains about.

If someone could clarify some things, that would be great. Thanks!

+4
source share
2 answers

You can see the module in Intellij as a project in Eclipse.

And a project in Intellij is the sum of the modules that make your project work.

When you create a module from existing sources, Intellij will add its module.iml configuration file to the specified location. Then all the configuration that you made in this module of the library will be reused when you import this module into another Intellij project.

+5
source

I know this post is pretty old, but still I found it, having run into similar issues like Niek. The structure of my project is similar to Niek's, with the library, "Full" and "Lite". The following describes what I migrated from Eclipse Luna to Android Studio 1.0.2 with the Android SDK 21.0.3. If this can help someone appear on this subject, it will make me a happy person!

  • Create a new project for Android Studio
  • Select the application module, press F4 to get the module settings
  • Select the "application" in the module settings and click the "-" button at the top to remove it.
  • Manually delete the application folder in the project folder
  • In the now empy project, go to the "File" menu, select "Import Module"
  • Import your first dependency (i.e. customLibrary from the Eclipse project structure below) by selecting a folder from the Eclipse workspace
  • make "F4" in the imported library, go to the "Dependencies" tab and add the Google modules (i.e. appcompat-v7 below).
  • Make another “Import Module” by selecting the “OwnLibrary” folder from the Eclipse workspace
  • Fix dependencies in the "Project Structure" by adding Google modules (here support-v4)
  • Repeat the “Import Module” operation for App_1 and App_2
  • Clean project; he must be rebuilt and be prepared.

If you have problems with minSDKVersion, modify your various manifests. I found some answers about what is here and there.

Eclipse Project Structure

 -MyProject- +--OwnLibrary | +--support-v4 | +--customLibrary | +--appcompat-v7 +-App_1 | +--OwnLibrary |-App_2 +--OwnLibrary 

ADDITION: When importing modules, if you change the name of the module, several additional steps will be taken, that is:

  1. From this eighth point after importing OwnLibrary

    • "F4" in your library, select the "almost duplicate" folder, delete it by clicking the "-" button in the upper left corner.
    • Go to the "Dependencies" section, delete the dependency with the name of the remote folder.
    • Add a new dependency with a new folder name.
    • Manually delete the folder deleted from the project.

Thomas.

0
source

Source: https://habr.com/ru/post/1481332/


All Articles