Flutter守护程序启动失败

7gs2gvoe  于 2023-05-08  发布在  Flutter
关注(0)|答案(8)|浏览(203)

每次打开VS code时都会收到此警告。有什么办法解决这个问题吗?谢谢大家。

我添加了这个警告的日志。我已经尝试了flutter cleanflutter doctor,一切都很好,但每次打开VS Code时仍然会出现此警告。我还遇到了一个问题,VS代码显示没有设备没有状态栏,但当我运行Flutter设备它显示有3个活动的设备。谢谢大家。

[12:07:27 pm] [General] [Info]         C:\Program Files\Intel\iCLS Client\bin
[12:07:27 pm] [General] [Info]         C:\windows\system32
[12:07:27 pm] [General] [Info]         C:\windows\system32\bin
[12:07:27 pm] [General] [Info]         C:\windows
[12:07:27 pm] [General] [Info]         C:\windows\bin
[12:07:27 pm] [General] [Info]         C:\windows\System32\Wbem
[12:07:27 pm] [General] [Info]         C:\windows\System32\Wbem\bin
[12:07:27 pm] [General] [Info]         C:\windows\System32\WindowsPowerShell\v1.0\
[12:07:27 pm] [General] [Info]         C:\windows\System32\WindowsPowerShell\v1.0\bin
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common\bin
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
[12:07:27 pm] [General] [Info]         C:\Program Files\Intel\Intel(R) Management Engine Components\DAL\bin
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
[12:07:27 pm] [General] [Info]         C:\Program Files\Intel\Intel(R) Management Engine Components\IPT\bin
[12:07:27 pm] [General] [Info]         C:\WINDOWS\system32
[12:07:27 pm] [General] [Info]         C:\WINDOWS\system32\bin
[12:07:27 pm] [General] [Info]         C:\WINDOWS
[12:07:27 pm] [General] [Info]         C:\WINDOWS\bin
[12:07:27 pm] [General] [Info]         C:\WINDOWS\System32\Wbem
[12:07:27 pm] [General] [Info]         C:\WINDOWS\System32\Wbem\bin
[12:07:27 pm] [General] [Info]         C:\WINDOWS\System32\WindowsPowerShell\v1.0\
[12:07:27 pm] [General] [Info]         C:\WINDOWS\System32\WindowsPowerShell\v1.0\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\MATLAB\R2018a\bin
[12:07:27 pm] [General] [Info]         C:\WINDOWS\System32\OpenSSH\
[12:07:27 pm] [General] [Info]         C:\WINDOWS\System32\OpenSSH\bin
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Brackets\command
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Brackets\command\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\PuTTY\
[12:07:27 pm] [General] [Info]         C:\Program Files\PuTTY\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\nodejs\
[12:07:27 pm] [General] [Info]         C:\Program Files\nodejs\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\Git\cmd
[12:07:27 pm] [General] [Info]         C:\Program Files\Git\cmd\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\dotnet\
[12:07:27 pm] [General] [Info]         C:\Program Files\dotnet\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\Go\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\Docker\Docker\resources\bin
[12:07:27 pm] [General] [Info]         C:\ProgramData\DockerDesktop\version-bin
[12:07:27 pm] [General] [Info]         C:\ProgramData\DockerDesktop\version-bin\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Programs\Python\Python39\Scripts
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Programs\Python\Python39\Scripts\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Programs\Python\Python39
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Programs\Python\Python39\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Microsoft\WindowsApps
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Microsoft\WindowsApps\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Roaming\npm
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Roaming\npm\bin
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Vim\vim82
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Vim\vim82\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\mosquitto
[12:07:27 pm] [General] [Info]         C:\Program Files\mosquitto\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.14\sbin
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\GnuWin32\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\OpenSSL-Win64
[12:07:27 pm] [General] [Info]         C:\Program Files\OpenSSL-Win64\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\OpenSSL-Win64\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\Handle
[12:07:27 pm] [General] [Info]         C:\Program Files\Handle\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.1\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\flutter\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\go\bin
[12:07:27 pm] [General] [Info]         C:\Chrome Driver Win32
[12:07:27 pm] [General] [Info]         C:\Chrome Driver Win32\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\PostgreSQL\13\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Programs\Microsoft VS Code\bin
[12:07:27 pm] [General] [Info]     Found at:
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\flutter\bin\
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\flutter\bin
[12:07:27 pm] [General] [Info]     Candidate paths to be post-filtered:
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\flutter
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\flutter
[12:07:27 pm] [General] [Info]     Found at C:\Users\nurfa\flutter
[12:07:27 pm] [General] [Info]     Returning SDK path C:\Users\nurfa\flutter for flutter.bat
[12:07:27 pm] [General] [Info] Searching for dart.exe
[12:07:27 pm] [General] [Info]     Looking for dart.exe in:
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\flutter\bin\cache\dart-sdk
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\flutter\bin\cache\dart-sdk\bin
[12:07:27 pm] [General] [Info]         C:\ProgramData\Oracle\Java\javapath
[12:07:27 pm] [General] [Info]         C:\ProgramData\Oracle\Java\javapath\bin
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Intel\iCLS Client\
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Intel\iCLS Client\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\Intel\iCLS Client\
[12:07:27 pm] [General] [Info]         C:\Program Files\Intel\iCLS Client\bin
[12:07:27 pm] [General] [Info]         C:\windows\system32
[12:07:27 pm] [General] [Info]         C:\windows\system32\bin
[12:07:27 pm] [General] [Info]         C:\windows
[12:07:27 pm] [General] [Info]         C:\windows\bin
[12:07:27 pm] [General] [Info]         C:\windows\System32\Wbem
[12:07:27 pm] [General] [Info]         C:\windows\System32\Wbem\bin
[12:07:27 pm] [General] [Info]         C:\windows\System32\WindowsPowerShell\v1.0\
[12:07:27 pm] [General] [Info]         C:\windows\System32\WindowsPowerShell\v1.0\bin
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common\bin
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
[12:07:27 pm] [General] [Info]         C:\Program Files\Intel\Intel(R) Management Engine Components\DAL\bin
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
[12:07:27 pm] [General] [Info]         C:\Program Files\Intel\Intel(R) Management Engine Components\IPT\bin
[12:07:27 pm] [General] [Info]         C:\WINDOWS\system32
[12:07:27 pm] [General] [Info]         C:\WINDOWS\system32\bin
[12:07:27 pm] [General] [Info]         C:\WINDOWS
[12:07:27 pm] [General] [Info]         C:\WINDOWS\bin
[12:07:27 pm] [General] [Info]         C:\WINDOWS\System32\Wbem
[12:07:27 pm] [General] [Info]         C:\WINDOWS\System32\Wbem\bin
[12:07:27 pm] [General] [Info]         C:\WINDOWS\System32\WindowsPowerShell\v1.0\
[12:07:27 pm] [General] [Info]         C:\WINDOWS\System32\WindowsPowerShell\v1.0\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\MATLAB\R2018a\bin
[12:07:27 pm] [General] [Info]         C:\WINDOWS\System32\OpenSSH\
[12:07:27 pm] [General] [Info]         C:\WINDOWS\System32\OpenSSH\bin
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Brackets\command
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Brackets\command\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\PuTTY\
[12:07:27 pm] [General] [Info]         C:\Program Files\PuTTY\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\nodejs\
[12:07:27 pm] [General] [Info]         C:\Program Files\nodejs\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\Git\cmd
[12:07:27 pm] [General] [Info]         C:\Program Files\Git\cmd\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\dotnet\
[12:07:27 pm] [General] [Info]         C:\Program Files\dotnet\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\Go\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\Docker\Docker\resources\bin
[12:07:27 pm] [General] [Info]         C:\ProgramData\DockerDesktop\version-bin
[12:07:27 pm] [General] [Info]         C:\ProgramData\DockerDesktop\version-bin\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Programs\Python\Python39\Scripts
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Programs\Python\Python39\Scripts\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Programs\Python\Python39
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Programs\Python\Python39\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Microsoft\WindowsApps
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Microsoft\WindowsApps\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Roaming\npm
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Roaming\npm\bin
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Vim\vim82
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\Vim\vim82\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\mosquitto
[12:07:27 pm] [General] [Info]         C:\Program Files\mosquitto\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.14\sbin
[12:07:27 pm] [General] [Info]         C:\Program Files (x86)\GnuWin32\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\OpenSSL-Win64
[12:07:27 pm] [General] [Info]         C:\Program Files\OpenSSL-Win64\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\OpenSSL-Win64\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\Handle
[12:07:27 pm] [General] [Info]         C:\Program Files\Handle\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2021.1\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\JetBrains\PyCharm Community Edition 2021.1.1\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\flutter\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\go\bin
[12:07:27 pm] [General] [Info]         C:\Chrome Driver Win32
[12:07:27 pm] [General] [Info]         C:\Chrome Driver Win32\bin
[12:07:27 pm] [General] [Info]         C:\Program Files\PostgreSQL\13\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\AppData\Local\Programs\Microsoft VS Code\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\flutter\bin\cache\dart-sdk
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\flutter\bin\cache\dart-sdk\bin
[12:07:27 pm] [General] [Info]     Found at:
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\flutter\bin\cache\dart-sdk\bin
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\flutter\bin\cache\dart-sdk\bin
[12:07:27 pm] [General] [Info]     Candidate paths to be post-filtered:
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\flutter\bin\cache\dart-sdk
[12:07:27 pm] [General] [Info]         C:\Users\nurfa\flutter\bin\cache\dart-sdk
[12:07:27 pm] [General] [Info]     Found at C:\Users\nurfa\flutter\bin\cache\dart-sdk
[12:07:27 pm] [General] [Info]     Returning SDK path C:\Users\nurfa\flutter\bin\cache\dart-sdk for dart.exe
[12:07:27 pm] [General] [Info] Experiment random number is 55 for experiement 'lsp-default'. Experiment is enabled for <= 100
[12:07:27 pm] [General] [Info] Experiment 'lsp-default' is activating (not first time)
[12:07:27 pm] [General] [Info] !! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!

Dart Code extension: 3.25.1
Flutter extension: 3.25.0 (not activated)

App: Visual Studio Code
Version: 1.59.0
Platform: win

Workspace type: Flutter
Analyzer type: LSP
Multi-root?: false

Dart SDK:
    Loc: C:\Users\nurfa\flutter\bin\cache\dart-sdk
    Ver: 2.13.4
Flutter SDK:
    Loc: C:\Users\nurfa\flutter
    Ver: 2.2.3

HTTP_PROXY: undefined
NO_PROXY: undefined
[12:07:27 pm] [FlutterDaemon] [Info] Spawning C:\Users\nurfa\flutter\bin\flutter.bat with args ["--no-sound-null-safety","daemon"]
[12:07:27 pm] [FlutterDaemon] [Info] ..  in C:\Users\nurfa\flutter
[12:07:27 pm] [FlutterDaemon] [Info] ..  with {"toolEnv":{"FLUTTER_HOST":"VSCode","PUB_ENVIRONMENT":"vscode.dart-code"}}
[12:07:27 pm] [FlutterDaemon] [Info]     PID: 39588
[12:07:27 pm] [FlutterDaemon] [Info] ==> [{"id":"1","method":"emulator.getEmulators"}]
[12:07:27 pm] [General] [Info] Spawning C:\Users\nurfa\flutter\bin\cache\dart-sdk\bin\pub.bat with args ["global","list"]
[12:07:27 pm] [CommandProcesses] [Info] (PROC 12148) Logging data for process...
[12:07:27 pm] [Analyzer] [Info] Spawning C:\Users\nurfa\flutter\bin\cache\dart-sdk\bin\dart.exe with args ["C:\\Users\\nurfa\\flutter\\bin\\cache\\dart-sdk\\bin\\snapshots\\analysis_server.dart.snapshot","--lsp","--client-id=VS-Code","--client-version=3.25.1"]
[12:07:27 pm] [Analyzer] [Info]     PID: 63952
[12:07:27 pm] [General] [Info] Activating Flutter extension for Flutter project...
[12:07:27 pm] [General] [Info] Extension:Startup timing: 58503ms
[12:07:27 pm] [Analyzer] [Info] ==> Content-Length: 4900
[12:07:27 pm] [Analyzer] [Info] ==> {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":39588,"clientInfo":{"name":"Visual Studio Code","version":"1.59.0"},"locale":"en-us","rootPath":"c:\\Users\\nurfa\\Desktop\\tracker_fisherman","rootUri":"file:///c%3A/Users/nurfa/Desktop/tracker_fisherman","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotati…
[12:07:28 pm] [General] [Info] !! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!

Dart Code extension: 3.25.1
Flutter extension: 3.25.0 (activated)

App: Visual Studio Code
Version: 1.59.0
Platform: win

Workspace type: Flutter
Analyzer type: LSP
Multi-root?: false

Dart SDK:
    Loc: C:\Users\nurfa\flutter\bin\cache\dart-sdk
    Ver: 2.13.4
Flutter SDK:
    Loc: C:\Users\nurfa\flutter
    Ver: 2.2.3

HTTP_PROXY: undefined
NO_PROXY: undefined
[12:07:28 pm] [CommandProcesses] [Info] (PROC 12148) devtools 2.5.0
[12:07:28 pm] [General] [Info] Found 0 folders requiring "pub get":
[12:07:28 pm] [CommandProcesses] [Info] (PROC 12148) exited (0, null)
[12:07:28 pm] [CommandProcesses] [Info] (PROC 12148) closed (0, null)
[12:07:28 pm] [General] [Info] devtools version 2.5.0 appears to be latest so returning Valid
[12:07:28 pm] [DevTools] [Info] Spawning C:\Users\nurfa\flutter\bin\cache\dart-sdk\bin\pub.bat with args ["global","run","devtools","--machine","--try-ports","10","--allow-embedding"]
[12:07:28 pm] [DevTools] [Info] ..  with {"toolEnv":{"FLUTTER_HOST":"VSCode","PUB_ENVIRONMENT":"vscode.dart-code"}}
[12:07:28 pm] [DevTools] [Info]     PID: 39588
[12:07:35 pm] [Analyzer] [Info] <== Content-Length: 384
Content-Type: application/vscode-jsonrpc; charset=utf-8

{"id":0,"jsonrpc":"2.0","result":{"capabilities":{"executeCommandProvider":{"commands":["edit.sortMembers","edit.organizeImports","edit.sendWorkspaceEdit","refactor.perform"],"workDoneProgress":true},"workspaceSymbolProvider":true,"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}}},"serverInfo":{"name":"Dart SDK LSP Analysis Server","version":"2.13.4"}}}
[12:07:35 pm] [DevTools] [Info] <== {"event":"server.started","method":"server.started","params":{"host":"127.0.0.1","port":9100,"pid":61224,"protocolVersion":"1.1.0"}}
zhte4eai

zhte4eai1#

在vs代码设置中搜索dart.flutterAdditionalArgs
并移除针对它的args。

dohp0rv5

dohp0rv52#

我已经通过以下步骤解决了此错误:

1.转到**{C://Users/{Name}/.gradle}-删除.gradle**文件。
1.然后下载并在其他位置安装相同的flutter和dart SDK版本,并设置环境变量。

Example:

Environment variables Before : ("D:\FlutterExtractedFiles\flutter\bin") ("D:\FlutterExtractedFiles\flutter\bin\cache\dart-sdk\bin")
Environment variables After : ("C:\edgedownloads\flutter_windows_v1.12.13+hotfix.8-stable\flutter\bin") ("C:\edgedownloads\flutter_windows_v1.12.13+hotfix.8-stable\flutter\bin\cache\dart-sdk\bin")
1.然后请检查android studio事件日志

7xzttuei

7xzttuei3#

这篇文章here是我编辑的。
请始终以文本而不是图像的形式发布错误日志。
1-运行flutter clean,然后运行flutter doctor并再次构建。
2-您是在模拟器还是物理设备上运行它?
3-如果是在模拟器上,增加该设备的虚拟RAM。更好的是,删除模拟器并创建一个新的。
4-如果还是不行,运行flutter upgrade
5-你能把文件构建成APK吗?换句话说,不是在设备上运行?
6-请发布flutter build apk -v的输出。

bzzcjhmw

bzzcjhmw4#

执行这些常规步骤:
1.运行flutter clean
1.运行flutter doctor
1.如果你正在使用一个模拟器,确保它有足够的空间,并尝试擦除它的数据和冷重启。
1.然后重新运行项目。

3lxsmp7m

3lxsmp7m5#

如果上面的不起作用,然后转到Android Studio,卸载所有你已经安装的SDK工具,然后重新安装它

p1tboqfb

p1tboqfb6#

将显式Web端口放入Profile Not设置

如果你遇到了Flutter Daemon failed to Start error,就像我在为web视图设置了一个显式端口后所做的那样:
1.删除VS代码设置中的--web-port行(Ctrl-,):

DELETE->> "dart.flutterAdditionalArgs": ["--web-port", "4593"]

1.打开.vscode/launch.json并将端口添加到启动配置文件中的“args”属性,例如:

{  "version": "0.2.0",
  "configurations": [
    {
      "name": "launch-chrome",
      "cwd": "cli",
      "request": "launch",
      "type": "dart",
ADD->> "args": [
        "--web-port", "4395", "-dchrome"
      ],
      "program": "${file}"

    }
  ]
}

我是为Web开发的,根据这个stackoverflow answer在VS代码设置中显式指定了端口,并发现由于某种原因,Flutter Daemon在启动时不喜欢这样。
端口仍然有效,但没有Flutter守护程序故障错误。
使用Windows 10。

hlswsv35

hlswsv357#

我也有同样的挣扎,上面的答案对我都不起作用。在搜索了很长一段时间后,我注意到在最新的macOS版本中,默认情况下某些权限的处理方式不同。在修复了权限问题并重新启动VS Code后,它开始正常工作。
在我的例子中,我必须在VS Code终端中运行这些命令:

sudo chown -R $(whoami) /Users/[MYUSERNAME]/Documents/flutter

(相应地更改路径,你下载或克隆flutter sdk -但使用父文件夹,而不是“/bin”像你的路径文件)
其次:

sudo chown -R $(whoami) /Users/[MYUSERNAME]/.pub-cache

希望这也能帮助到外面的人:-)

gcxthw6b

gcxthw6b8#

尝试重新下载android平台工具

相关问题