git 无效的 VCS 根映射 - 我的项目中有 3 个错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/46311661/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 05:07:49  来源:igfitidea点击:

Invalid VCS root mapping - 3 errors on my project

gitandroid-studioversion-control

提问by Ali Al-Fayed

When I import project to Android Studio, I found this errors:

当我将项目导入到 Android Studio 时,我发现了以下错误:

  • Error:No resource found that matches the given name (at 'label' with value '@string/filter_title_awesomeChat').

  • Error:No resource found that matches the given name (at 'label' with value '@string/filter_title_awesomeChat').

  • Error:Execution failed for task ':app:processFreeReleaseResources'. com.android.ide.common.process.ProcessException: Failed to execute aapt

    Invalid VCS root mapping

    The directory C:\Users\alfayed\Desktop\awesome-chat is registered as a Git root, but no Git repositories were found there.

  • 错误:找不到与给定名称匹配的资源(在“标签”处,值为“@string/filter_title_awesomeChat”)。

  • 错误:找不到与给定名称匹配的资源(在“标签”处,值为“@string/filter_title_awesomeChat”)。

  • 错误:任务 ':app:processFreeReleaseResources' 执行失败。com.android.ide.common.process.ProcessException:无法执行 aapt

    无效的 VCS 根映射

    目录 C:\Users\alfayed\Desktop\awesome-chat 已注册为 Git 根目录,但在那里找不到 Git 存储库。

Screenshot of errors

错误截图

采纳答案by Sergio Guerjik

Make sure the project was cloned and not downloaded as a zip into the directory you are using (there should be C:\Users\paula\Git\OpenTripPlanner.git directory on your disk). and make sure your gpath to git executable is indicating the correct path.

确保项目是克隆的,而不是作为 zip 下载到您正在使用的目录中(您的磁盘上应该有 C:\Users\paula\Git\OpenTripPlanner.git 目录)。并确保您的 git 可执行文件的 gpath 指示正确的路径。

回答by daisymber18

For the Invalid VCS root mapping erroryou can fix it by deleting the vcs.xmlfile located in the .ideafolder of your project and then rebuild your project.

对于无效的 VCS 根映射错误,您可以通过删除vcs.xml位于.idea项目文件夹中的文件然后重建项目来修复它。

回答by Marina Liu

The three Gradle Build errors seems separate from the invalid VCS root mapping error.

三个 Gradle Build 错误似乎与无效的 VCS 根映射错误不同。

  • For the invalid VCS root mapping error, you can go to the root of the project C:\Users\alfayed\Desktop\awesome-chat, and create a git repo by git init.

  • For the three Gradle Build errors, you can debug the details with the source code.

  • 对于无效的VCS根映射错误,可以到项目根目录下C:\Users\alfayed\Desktop\awesome-chat,通过.git repo创建一个git repo git init

  • 对于三个 Gradle Build 错误,可以通过源码调试细节。

回答by Dhruv Parmar

all you need is to delete the vcs.xml file inside an .idea folder this works!

您只需要删除 .idea 文件夹中的 vcs.xml 文件即可!

回答by Hardeep Singh

For resolving "Invalid VCS root mapping"

用于解决“无效的 VCS 根映射

Make sure the project was cloned and not downloaded as a zip into the directory you are using (there should be C:\Users\alfayed\Desktop\awesome-chat.git directory on your disk).

确保项目是克隆的,而不是作为 zip 下载到您正在使用的目录中(您的磁盘上应该有 C:\Users\alfayed\Desktop\awesome-chat.git 目录)。

回答by Manideep

For the Invalid VCS root mappingerror, you can fix it by deleting the vcs.xmlfile located in the .ideafolder of your project and then Reopen your IDE.

对于Invalid VCS root mapping错误,您可以通过删除vcs.xml位于.idea项目文件夹中的文件然后重新打开 IDE来修复它。

回答by altin bana

For the Invalid VCS root mapping error, deleting the .idea folder of your project and then rebuild your project.

对于 Invalid VCS root mapping 错误,删除项目的 .idea 文件夹,然后重新构建项目。