Unity 报错No ‘git‘ executable was found. Please install Git on your system then restart

亲测可用。

An error occurred while resolving packages:Project has invalid dependencies:
  com.unity.xxx: No 'git' executable was found. Please install Git on your     system then restart Unity and Unity Hub

在我们使用PackageManager时,Unity允许我们使用Git上的package(点击加号,选择add package from git URL,或者是直接在Asset/Packages/manifest.json中添加包名)。

但是这种操作需要我们事先装好git,并且配置好相应的环境变量,否则会报错。

解决方法:

1.下载,安装Git。 Git - Downloads

2.配置系统环境变量。我这里使用的是win7,所以在path后面继续加入路径的时候,需要使用英文分号分割;C:\Program Files\Git\bin(注意这个路径需要定位到git.exe)  , 如下图

3.重新打开cmd,输入git测试成功。

4.重新打开unity和unity hub,如果仍然报错,去系统进程看看,是否没有把untiy或者unity hub彻底关掉。

扫描二维码关注公众号,回复: 14757296 查看本文章

猜你喜欢

转载自blog.csdn.net/Ling_SevoL_Y/article/details/124403207