【错误记录】flutter pub get 执行报错 ( 打开 Windows 开发者模式 )

文章目录

一、错误记录


核心报错信息 :

shell 复制代码
Building with plugins requires symlink support.

Please enable Developer Mode in your system settings. Run
  start ms-settings:developers
to open settings.

完整命令行输出 :

shell 复制代码
D:\002_Project\001_Flutter\client_terminal>flutter pub get
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Resolving dependencies...
Downloading packages...
  matcher 0.12.19 (0.12.20 available)
  meta 1.17.0 (1.18.2 available)
  test_api 0.7.10 (0.7.12 available)
  vector_math 2.2.0 (2.3.0 available)
Got dependencies!
4 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Building with plugins requires symlink support.

Please enable Developer Mode in your system settings. Run
  start ms-settings:developers
to open settings.

二、解决方案


执行

shell 复制代码
start ms-settings:developers

命令 , 在弹出的页面中打开 开发者选项 ;

报错提示 :

shell 复制代码
Please enable Developer Mode in your system settings. Run
  start ms-settings:developers
to open settings.

请在系统设置中开启开发者模式 ; 执行下面命令可直接打开设置页面 : start ms-settings:developers

Windows 开发者模式 = 给开发用的 " 特权模式 " , 平时普通用户不用开 , 但做 Flutter/Android/UWP 开发必须开 , 否则很多编译、链接、调试功能会被系统禁止 ;

Windows 开发者模式 是 Windows 自带的一个开发总开关Microsoft Learn ;

关掉开发者模式 , 系统只让你装 微软商店 ( Microsoft Store ) 里的软件 , 限制很多底层 / 调试 / 链接功能 ;

打开开发者模式 , 解除限制 , 允许 :

  • 安装非商店来源的测试包、未签名应用 ( 侧载 )
  • 启用调试、远程部署、SSH、设备门户等开发功能Microsoft Learn
  • 创建符号链接 ( symlink ) ------ 这就是你 Flutter 报错的关键点!

对 Flutter 来说最关键的一点 : Flutter 在 Windows 编译安卓 / 插件时 , 会大量创建 符号链接 ( symlink ) 来关联插件和引擎 ;

没开开发者模式 → Windows 不让创建 symlink → 直接报错 :

执行

shell 复制代码
start ms-settings:developers

命令 , 在弹出的页面中打开 开发者选项 ;

或者在 控制面板 / 更新和安全 / 开发者选项 页面中 , 打开开发者模式 ;

打开该选项 ;

设置完毕后 , 执行 flutter pub get 命令 , 不再报错 ;

shell 复制代码
D:\002_Project\001_Flutter\client_terminal>flutter pub get
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Resolving dependencies...
Downloading packages...
  matcher 0.12.19 (0.12.20 available)
  meta 1.17.0 (1.18.2 available)
  test_api 0.7.10 (0.7.12 available)
  vector_math 2.2.0 (2.3.0 available)
Got dependencies!
4 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.

D:\002_Project\001_Flutter\client_terminal>
相关推荐
Funlang9 小时前
在 Windows 95 上跑 Fun
windows
传奇开心果编程13 小时前
【Flutter踩坑排雷】第28课:平台目录缺失与修复坑|`flutter create` 的“重建”与“覆盖”边界
android·flutter·ios·移动开发·跨平台·dart·声明式ui
ö Constancy14 小时前
一台电脑的硬件组成与作用:按功能分类详解(Windows 与 Linux 视角)
linux·windows·电脑
程序员老刘·1 天前
Flutter 3.50更新,开发者应该关注什么?
flutter·ai编程·跨平台开发
雪落漂泊2 天前
Liunux进程(七):程序控制篇(中)
linux·运维·windows
传奇开心果编程2 天前
【Flutter踩坑排雷】第25课:ScrollController 误用坑|跳转失效、监听泄漏与“控制器未附加”
android·flutter·ios·移动开发·跨平台·dart·声明式ui
程序员老刘2 天前
Flutter 3.50更新,开发者应该关注什么?
flutter·ai编程·客户端
承渊政道2 天前
Fooocus本地AI绘图教程:Windows部署、低门槛生图与远程访问
人工智能·windows·cpolar·fooocus·生图
陈工大模型2 天前
收到乱码压缩包之后,我重新测了 7-Zip、Bandizip 和win解压缩
windows·电脑·软件工程·软件需求·7-zip
谙弆悕博士2 天前
在文件夹右键直接打开 Kali WSL:一条 `wsl --cd` 注册表脚本
windows·脚本·wsl·右击·ksli