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
相关推荐
Nerd(BUG版)10 小时前
Flutter学习day5--事件手势与命中测试
学习·flutter
传奇开心果14 小时前
【Flutter踩坑排雷】第5课:扩展方法冲突坑|同名扩展引发编译歧义,故障规避手段
android·flutter
雪铃儿1 天前
Flutter 双端热更新新方案:基于 Dart 官方动态模块的 flutter_patcher 1.0.0
flutter·hotfix
好的佩奇2 天前
Dart 之方法、操作符与可调用对象
android·flutter·dart
恋猫de小郭2 天前
Flutter Impeller Vulkan 内存持续上涨,问题没想到是文字阴影
android·前端·flutter
传奇开心果2 天前
【Flutter踩坑排雷】第3课:const 误用坑|const 错误使用引发 UI 异常与性能损耗
android·flutter
行者-全栈开发3 天前
Flutter 插件 device_calendar_plus 开源鸿蒙适配实战:从权限弹窗失灵到循环日程跑通
flutter·跨平台·harmonyos·arkts·日历·适配·开源鸿蒙
恋猫de小郭3 天前
Flutter 开始支持 Jetpack Compose Platform View
android·前端·flutter
SoaringHeart3 天前
Flutter 查缺补漏:@JsonKey 属性全解,让模型层不再被后端字段牵着走
flutter