在系统环境变量中添加Git的路径。
步骤如下:
打开终端(Terminal)并输入“which git”,查看Git的安装路径。
如果没有Git的安装路径,需要先安装Git并设置环境变量。
右键点击“计算机”,选择“属性”-“高级系统设置”-“环境变量”-“系统变量”,找到“Path”变量并点击“编辑”。
在变量值的末尾添加Git的安装路径。
例如:
C:\Program Files\Git\bin
C:\Program Files\Git\cmd
注意:每个路径之间需要以分号“;”隔开。
点击“确定”并关闭所有打开的窗口。
此时再次打开Android Studio并运行flutter命令,就不会再出现“Unable to find git in your PATH”的错误提示了。
上一篇:AndroidStudio提示“Error:ThisclassimplementsParcelablebutdoesnotprovideaCREATORfield[ParcelCreator]”。
下一篇:AndroidStudio提示“ModuledoesnothaveanassociatedAndroidFacet,无法编译代码。