In Android Studio, when I import a project downloaded from link,
I get an error as
"Invalide VCS root mapping" The directory C:\Users\username\Desktop\video_diary-master is registered as a Git root, but no Git repositories were found there.
In Android Studio, when I import a project downloaded from link,
I get an error as
"Invalide VCS root mapping" The directory C:\Users\username\Desktop\video_diary-master is registered as a Git root, but no Git repositories were found there.
In my situation I didn't have to work with git, I just wanted to run the project that I had downloaded and that was prompting me this error
On Android Studio 3.0 I clicked on Configure in the popup window appeared on the bottom right corner
This automatically opened a window [accessible as well through File->Settings] on Version Control tab. I selected the first item in the bigger list and I removed it clicking on the red minus sign
After this the error should disappear
There is a .idea folder within the repository which shouldn't be there. Inside it are vcs related files which might contain a path not on your PC.
Make sure there is a .git folder within the project fold er on your PC. If not then you'll have to clone the project properly if you need the vcs tools enabled. Here's a link on how to do that: Git Basics, search for Cloning an Existing Repository
Then, you'll need to close Android Studio, delete the .idea folder and then open Android Studio again. It'll recreate the .idea folder and problem should be resolved.
I wanted to start project by taking pull from git repository.But the same error described poped up during initialization -
So to solve this - -
On Android Studio 3.0, I clicked on Configure in the popup window appeared on the bottom right corner
When you click it, this screen will popup-
This screen will have one config marked as red (Currently not visible) -
Select it and click on the edit button in the right
A new screen will popup -
On this select the project radio button
Then click ok and apply.
The error will go away and the git will work perfectly.
If you have git installed and the project is a cloned repo from Github, check if you project folder has the .git folder missing.
if this folder is not found, using the Terminal, change to your project directory and run the following:
$ git init
You may hav lost your .git directory or it may have been corrupted after your initial clone from Github. Some unforseen issues may arise depending on what happened after. So Read below in case of git Push problems:
I have done this and error notification is gone,
Click on Configure,
It will take us to VCS project repository tab,
Here i have selected that project name and clicked on Minus sign in right side,
Now hit Apply and click OK
And doing this my notification is gone.
Click the config in the error
Click on the project directory marked red, besides it there is a an edit button, click on it , another window opens up, click on the project button ,click ok and the error disappears.
Rename your current project folder (the new one you want to put on GitHub) to something like MyProjectBackup.
In Android Studio, go to File > New > File from Version Control > GitHub. Then log in with your GitHub username and password and select your old project's repository name from the list of your GitHub repos. Continue through the import wizard and you should end up with your old project in Android Studio. (Now, for example, your old project is in MyProject and your new project is in MyProjectBackup).
Manually delete everything except for .git and .gitignore (and maybe the readme and license) from your MyProject project folder.
In my condition i have clicked on "Configure". It opens settings In that I have removed the URL(Error Address). It works for me.
also I am using linux. So I have installed git program on my pc.
using this :
sudo apt-get install git.
I had the same problem as above. When i clicked the "configure" below the error message, I realized that not all my modules where in the same project folder on my system(windows in my case). To be precise, the module which was giving this error was not in the project folder.
To solve it, i just deleted the module from intelliJ by going to file->project structure->click "Modules" in the window that pops up -> select the module that gives the error and remove it by clicking the '-' (minus) sign.
I added the same module again from the Version Control System(git in my case) and made sure i selected the correct project folder this time.
or select vcs none.
Hope this helps.
I had the same issue, when I copied an Android Studio project to make a different version and then share it on GitHub.
Invalide VCS root mapping The directory C:\Users\username\my_project_copy is registered as a Git root, but no Git repositories were found there.
I've solved by going to
File -> Settings -> Version Control -> Directory Mapping
then removing the directory displayed on the map.
After this I clicked on + and added the root directory.
Hope this could help!
Click on configure -> a popup will open, click on red colored path to highlight it-> now on the right side-> click on - button then apply and ok.
Now Click on VCS menu-> Enable Version control System
You are done.
to solve your problem at first u should clone your project not download as zip file by git bash $ git clone and if u want to put it in new folder do it $ git clone then init project in path what u want to clone it $ git init then $ git add *
When you clone a repository from Github it has a .git file that supports version control locally. However if it is not present you will get the error as given in the question.The error means that the repository is cloned and hence is supposed to provide version control and all VCS features as in github using the .git file,but the .git file is absent so version control cant be provided.Thus to get version control you will have to explicitly create a .git in the project folder. 1. Open git bash 2. Reach that folder using the- cd path to that folder 3. Then create .git by running the following command
$ git init
Initialized empty Git repository in D:/AndroidProject1/UdiBaba2/Udi_Baba-master/.git/
To understand more on this subject follow the link- https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository
If you do not want version control for the project, you can simply tap on the floating box, it will take you to Settings>Version Control . There you can click on the small "-" symbol at the extreme right. Clicking this means that you don't want the project to offer version control hence .git is no more necessary now.
You need to clone it as follows:
make a new folder, right click on it, click Git Bash here, then type:
$ git clone https://github.com/repo name
the repo will get cloned having .git folder & .gitignore file. You can make changes which are considered as modified files. Use following commands to add modified files to git repo:
To add all untracked files to tracked files:
git add -A git
To commit changes:
commit -a -m "Message"
Finally to push to online repo:
git push origin branchname
When you clone your project from git make sure you do (USUALLY missing the "RECURSIVE" flag is what causes the VCS root problem):
git clone --recursive YOUR-GIT-URL
or if you have already cloned then to fix it:
git submodule init
git submodule update