问题描述
原本在 macOS 开发的项目,现在 Windows 10 运行时报如下错误:
1 2 3 4 5 6 7 8 |
Building Windows application... /C:/Users/Administrator/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/win32-5.5.0/lib/src/guid.dart(32,9): error G5FE39F1E: Type 'UnmodifiableUint8ListView' not found. [D:\Source\xxxx\build\windows\x64\flutter\flutter_assemble.vcxproj] /C:/Users/Administrator/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/win32-5.5.0/lib/src/guid.dart(32,9): error G027421CC: 'UnmodifiableUint8ListView' isn't a type. [D:\Source\xxxx\build\windows\x64\flutter\flutter_assemble.vcxproj] /C:/Users/Administrator/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/win32-5.5.0/lib/src/guid.dart(52,17): error G311314CC: Method not found: 'UnmodifiableUint8ListView'. [D:\Source\xxxx\build\windows\x64\flutter\flutter_assemble.vcxproj] /C:/Users/Administrator/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/win32-5.5.0/lib/src/guid.dart(56,31): error G311314CC: Method not found: 'UnmodifiableUint8ListView'. [D:\Source\xxxx\build\windows\x64\flutter\flutter_assemble.vcxproj] /C:/Users/Administrator/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/win32-5.5.0/lib/src/guid.dart(100,17): error G311314CC: Method not found: 'UnmodifiableUint8ListView'. [D:\Source\xxxx\build\windows\x64\flutter\flutter_assemble.vcxproj] D:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: “D:\Source\xxxx\build\windows\x64\CMakeFiles\3280cb0897b7497e569be324d43ba4f0\flutter_windows.dll.rule;D:\Source\xxxx\build\windows\x64\CMakeFiles\7cbe39a26ff33b9ec6d721697d74fbd8\flutter_assemble.rule”的自定义生成已退出,代码为 1。 [D:\Source\xxxx\build\windows\x64\flutter\flutter_assemble.vcxproj] Error: Build process failed. |
解决方法
1 2 3 4 5 6 7 8 9 |
$ flutter pub upgrade win32 $ flutter pub cache clean $ flutter channel stable $ flutter clean && flutter pub get $ flutter pub upgrade |