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 小时前
CPF-Flutter 社区提出折叠场景分栏(平行视界) 方案
android·前端·flutter
程序员老刘15 小时前
Android Studio Quail 4发布,看日志我以为谷歌放弃Flutter了
flutter·android studio·ai编程
Crazy_MT16 小时前
Flutter 本地大模型实战:做一个自然语言记账工具
flutter·llm·ai编程
嵩风抚1 天前
一款HK银行APP的业务+技术
android·flutter·react native·html5
不羁的木木1 天前
给鸿蒙 App 增加广播收发能力 —— flutter_broadcasts 的鸿蒙使用指南
flutter·harmonyos
不羁的木木1 天前
给鸿蒙 App 增加打开外部网页能力 —— flutter_web_browser 的鸿蒙使用指南
前端·flutter·harmonyos
安好说AI1 天前
Flutter 三方库 sound_mode 的鸿蒙化适配指南:免权限读取与受限写入的契约对齐
flutter·harmonyos·鸿蒙
●VON1 天前
Flutter 鸿蒙 disk_space_2 1.0.13 使用实战:下载前检查磁盘空间
flutter·华为·harmonyos·鸿蒙
●VON1 天前
Flutter 鸿蒙插件适配实战:用 device_screen_brightness 2.0.0 控制并监听屏幕亮度
flutter·华为·harmonyos
风早爽太2 天前
Flutter 开发笔记:share_plus 分享插件
笔记·flutter