Android Studio - Invalid VCS Root Mapping when using "New Project from Version Control"

19,131

For the invalid VCS root mapping error, you can go to the root of the project, and create a git repo by git init.

You can also fix it by deleting the vcs.xml file located in the .idea folder of your project and then Reopen your IDE

Thanks

Share:
19,131
Nick
Author by

Nick

Updated on June 04, 2022

Comments

  • Nick
    Nick almost 2 years

    We are developing an SDK which will be rolled out to our clients, as well as several apps which will use the SDK. In order to develop the SDK, its easiest to have a master project - such as a test app which has the SDK included as a module. This allows it the source to be available during debugging and is much easier to make bug fixes to the SDK.

    My expectation was that when using Android Studio to create a "New Project from Version Control" (file menu) that the submodules specified in .gitmodules would be cloned also, however this is not the default behavior. When performing this action on a repo with .gitmodules, and the settings.gradle has an include statement for the module (makes sense right?), AS displays an error of a VCS root with no source. "Is registered as git root, but no git repositories were found there"

    1. Is there a reason why it shouldn't be the default behavior? Is this a git thing?
    2. If I want to update this behavior, is this a git alias thing (suggested here) or is there an Android Studio config to make it use something like git clone --recursive?

    My goal is to reduce friction for new developers on my team. I am considering just using SourceTree (which automatically clones submodules) or writing the git commands required as a reference, however I prefer when things work as expected via the IDE.

    The environment is Android Studio 1.5.1 & git 1.9.X - both windows 7 and OSX.