Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 253
Nick Avatar asked Mar 14 '16 22:03

Nick


1 Answers

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

like image 152
Anuj Sharma Avatar answered Oct 18 '22 13:10

Anuj Sharma