Flutter Error: Type ‘UnmodifiableUint8ListView‘ not found

问题描述

原本我在Mac开发的项目,现在win10运行时报如下错误:

复制代码
../../../AppData/Local/Pub/Cache/hosted/pub.dev/win32-3.1.4/lib/src/guid.dart:31:9: Error: Type 'UnmodifiableUint8ListView' not found.
final UnmodifiableUint8ListView bytes;
^^^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/win32-3.1.4/lib/src/guid.dart:31:9: Error: 'UnmodifiableUint8ListView' isn't a type.
final UnmodifiableUint8ListView bytes;
^^^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/win32-3.1.4/lib/src/guid.dart:51:17: Error: Method not found: 'UnmodifiableUint8ListView'.
return Guid(UnmodifiableUint8ListView(guid));
^^^^^^^^^^^^^^^^^^^^^^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/win32-3.1.4/lib/src/guid.dart:55:31: Error: Method not found: 'UnmodifiableUint8ListView'.

AS运行Flutter Doctor正常

问题分析

需要将 win32 软件包版本升级到最新版本,或者运行flutter pub upgrade命令将正在使用的所有依赖项升级到最新版本,最终解决问题。

问题解决

**方案一、**降级Flutter

**方案二、**执行命令,以更新软件包

vbscript 复制代码
flutter pub upgrade win32

//如果 pub upgrade win32 无法正常工作,只需运行以下命令
flutter pub global activate -s git https://github.com/jonataslaw/get_cli

flutter pub cache clean

flutter channel stable

flutter clean && flutter pub get

flutter pub upgrade
相关推荐
恋猫de小郭1 天前
你还用 IDE 吗? AI 狂欢时代下 Cursor 慌了, JetBrains 等 IDE 的未来是什么?
前端·flutter·ai编程
TT_Close2 天前
🐟 发布中心进度同步:8 个商店的上传功能开发完毕,正抓紧测试
flutter·npm·visual studio code
RaidenLiu2 天前
Flutter Platform Channel 底层架构解析 —— 从 BinaryMessenger 到跨平台消息通信机制
前端·flutter·前端框架
鹏多多2 天前
Flutter使用screenshot进行截屏和截长图以及分享保存的全流程指南
android·前端·flutter
恋猫de小郭2 天前
什么 AI 写 Android 最好用?官方做了一个基准测试排名
android·前端·flutter
勤劳打代码4 天前
Flutter 架构日记 — 状态管理
flutter·架构·前端框架
比特鹰5 天前
手把手带你用Flutter手搓人生K线
前端·javascript·flutter
火柴就是我5 天前
Flutter限制输入框只能输入中文,iOS拼音打不出来?
flutter
TT_Close5 天前
【Flutter×鸿蒙】debug 包也要签名,这点和 Android 差远了
android·flutter·harmonyos
TT_Close6 天前
【Flutter×鸿蒙】FVM 不认鸿蒙 SDK?4步手动塞进去
flutter·swift·harmonyos