Home » Android » java – How to import modules from SVN in AndroidStudio

java – How to import modules from SVN in AndroidStudio

Posted by: admin May 14, 2020 Leave a comment


I’m migrating from Eclipse to Android Studio.

In my Eclipse’s workspace I have the following structure:

  • MyApp (pointing to SVN repo 1)
  • Library B (pointing to SVN repo 2)
  • Library C (pointing to SVN repo 3)

When I import it to AndroidStudio it creates a single project with 3 modules:

  • App
  • LibraryB
  • LibraryC

LibraryB and LibraryC are used in multiple projects so I need to commit them in a separate SVN and include it in MyApp as a svn:external.

Those are the steps I’m trying with but I think I’m doing it wrong:

  • Select the whole project: VCS->Enable Version Control Integration -> Subversion
  • Right-click LibraryB -> Subversion -> Share Directory, select the SVN location for the module, and then Right-click LibraryB -> Subversion -> Commit Directory excluding the build folder.

At this point the module is in the SVN repo so I try to import it to a new project. I create a new project.

How can I checkout the module to the new project, allowing to commit changes in the module to the module’s SVN?

I have tried:

  • At the new project I create a folder named libraryB and then bring the module files with VCS->Checkout From Version Control. At this point I’m prompted with You have checked out an Android Studio project file C:/path/to/Project/libraryB/build.gradle I press No and then try. Project Structure-> + Module-> Import Existing Project (as a module) -> select the path C:/path/to/Project/libraryB but the wizard shows an error Select modules to import
  • Setup the SVN configuration in the new project, then right-click->Subversion-> Create external. With the checkbox checkout enabled select the svn path and the local folder. The files are retrieved but not as a module.


How to&Answers:

On checking out the project, Create a new module with the same name of your modules.

copy your main folder and also the build.gradle to the new module.

Right click on the module> subversion> Share Directory.
Point the svn location where you want to share your module.