I started vs code and got the error flutter daemon failed to start. I opened the log and the error was that git was not found in path even though i have added git to path. Here is the log
[6:54:12 PM] [FlutterDaemon] [Info] Spawning C:flutterbinflutter.bat with args ["daemon"]
[6:54:12 PM] [FlutterDaemon] [Info] .. in C:flutter
[6:54:12 PM] [FlutterDaemon] [Info] .. with {"toolEnv":{"FLUTTER_HOST":"VSCode","PUB_ENVIRONMENT":"vscode.dart-code","FLUTTER_ROOT":"C:\flutter"}}
[6:54:12 PM] [FlutterDaemon] [Info] PID: 14948
[6:54:12 PM] [Analyzer] [Info] Spawning C:flutterbincachedart-sdkbindart.exe with args ["language-server","--protocol=lsp","--client-id=VS-Code","--client-version=3.74.0"]
[6:54:12 PM] [Analyzer] [Info] PID: 21988
[6:54:12 PM] [General] [Info] Returning cached results for project search
[6:54:12 PM] [General] [Info] Activating Flutter extension for Flutter project...
[6:54:12 PM] [DevTools] [Info] Spawning C:flutterbincachedart-sdkbindart.exe with args ["devtools","--machine","--try-ports","10","--allow-embedding"]
[6:54:12 PM] [DevTools] [Info] .. with {"toolEnv":{"FLUTTER_HOST":"VSCode","PUB_ENVIRONMENT":"vscode.dart-code","FLUTTER_ROOT":"C:\flutter"}}
[6:54:12 PM] [DevTools] [Info] PID: 14948
[6:54:12 PM] [General] [Info] Version last used for Pub is 3.1.5 (3.1.0), current is 3.1.5 (3.1.0)
[6:54:12 PM] [General] [Info] Found 0 folders requiring "pub get" or "pub upgrade":
[6:54:12 PM] [Analyzer] [Info] ==> Content-Length: 6429
[6:54:12 PM] [Analyzer] [Info] ==> {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":14948,"clientInfo":{"name":"Visual Studio Code","version":"1.83.1"},"locale":"en","rootPath":"c:\Windows\System32\learningdart","rootUri":"file:///C%3A/Windows/System32/learningdart","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsO…
[6:54:12 PM] [General] [Info] Loaded 20000 package names from vscode-userdata:/c%3A/Users/preda/AppData/Roaming/Code/User/globalStorage/dart-code.dart-code/package_cache.json
[6:54:12 PM] [FlutterDaemon] [Info] <== Error: Unable to find git in your PATH.
2
Answers
I reinstalled git and launched the flutter project from cmd and it worked but now when i try to run i get this error:
I managed to locate the xml file that causes the error but i dont know what to do with it. Anyone can help?
Ensure that Git’s bin directory is included in your system’s PATH environment variable.
Update the git path using the following steps:
For Windows:
C:Program FilesGitbin
) is listed. If not, add it.For macOS and Linux:
.bashrc
or.profile
) in a text editor./usr/local/git/bin
) is included in the PATH variable. If not, add it, and save the file.