You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

激活Flutter screenshots时持续出现File.create错误求助

安装screenshots工具时pub global activate报错

环境与操作步骤

  • 系统:macOS
  • 按照screenshots官方文档步骤操作,已完成:
    1. brew update && brew install imagemagick
    2. 执行pub global activate screenshots时触发报错

报错信息

执行pub global activate screenshots时出现以下错误:

  • File.create方法的命名参数少于被重写的方法,缺少exclusive参数
  • ForwardingFile.createSync、MemoryFile.createSync存在类似参数不匹配问题
  • platform包中找不到packageRoot成员

已尝试的无效解决方案

  • 删除pubspec.lock文件
  • 执行flutter pub get
  • 执行dart pub upgrade

附加信息

pub outdated截图:
pub outdated 截图

内容的提问来源于stack exchange,提问作者Lim Jiexian

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.30 20:06:27