美文网首页
vs code 使用 fvm 版本配置

vs code 使用 fvm 版本配置

作者: tom__zhu | 来源:发表于2025-07-17 10:16 被阅读0次

VS Code 已经使用 fvm 配置了 flutter 版本,但是编译时报错,表示 VS Code 并没有使用 fvm 配置的版本

The current Dart SDK version is 2.19.6.
Because task_manager requires SDK version ^3.0.0, version solving failed.

解决方式
在 VS Code 中找到 .vscode-》settings.json 并把下面的内容复制进去

{
  "dart.flutterSdkPath": ".fvm/flutter_sdk",
  // (可选) 自动在保存时格式化代码
  "editor.formatOnSave": true,
  // (可选) 设置格式化工具为 Flutter/Dart 官方工具
  "editor.defaultFormatter": "Dart-Code.flutter",
  // (可选) 排除 .fvm 文件夹在文件搜索中的干扰
  "search.exclude": {
    "**/.fvm": true
  },
  // (可选) 排除 .fvm 文件夹在文件监视中的干扰
  "files.watcherExclude": {
    "**/.fvm": true
  }
}

相关文章

网友评论

      本文标题:vs code 使用 fvm 版本配置

      本文链接:https://www.haomeiwen.com/subject/hwfenjtx.html