I created a Flutter project, that targets Android, iOS, macOS, Linux and Windows.
It works well on both Android and iOS, but when I try to compile it on Windows 10, I got the following error:
/C:/Users/Matt/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.5.0/lib/src/guid.dart(32,9): error G7D2AEF3C: Type 'UnmodifiableUint8ListView' not found. [D:ProjectsMyProjectmyprojectbuildwindowsx64flutterflutter_assemble.vcxproj]
/C:/Users/Matt/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.5.0/lib/src/guid.dart(32,9): error G94EA939C: 'UnmodifiableUint8ListView' isn't a type. [D:ProjectsMyProjectmyprojectbuildwindowsx64flutterflutter_assemble.vcxproj]
/C:/Users/Matt/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.5.0/lib/src/guid.dart(52,17): error GB1B8BC88: Method not found: 'UnmodifiableUint8ListView'. [D:ProjectsMyProjectmyprojectbuildwindowsx64flutterflutter_assemble.vcxproj]
/C:/Users/Matt/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.5.0/lib/src/guid.dart(56,31): error GB1B8BC88: Method not found: 'UnmodifiableUint8ListView'. [D:ProjectsMyProjectmyprojectbuildwindowsx64flutterflutter_assemble.vcxproj]
/C:/Users/Matt/AppData/Local/Pub/Cache/hosted/pub.dev/win32-5.5.0/lib/src/guid.dart(100,17): error GB1B8BC88: Method not found: 'UnmodifiableUint8ListView'. [D:ProjectsMyProjectmyprojectbuildwindowsx64flutterflutter_assemble.vcxproj]
C:Program Files (x86)Microsoft Visual Studio2019BuildToolsMSBuildMicrosoftVCv160Microsoft.CppCommon.targets(241,5): error MSB8066: la build personnalisée de 'D:ProjectsMyProjectmyprojectbuildwindowsx64CMakeFiles0f4297bda59febfcdc266bbd2530f6dflutter_windows.dll.rule;D:ProjectsMyProjectmyprojectbuildwindowsx64CMakeFiles785f825a0ac974305d35d5e7685e38b2flutter_assemble.rule' s'est arrêtée. Code�1. [D:ProjectsMyProjectmyprojectbuildwindowsx64flutterflutter_assemble.vcxproj]
I tried flutter clean
then flutter pub get
but the bug remains.
Has anyone encountered this error? How can I fix that?
Thanks.
2
Answers
OK so here is what I did to fix the problem:
flutter pub upgrade win32
You can switch to stable version of flutter as that is connected to Dart version 3.4.3 currently (whereas master is connected to Dart 3.5.0, which has a breaking change causing the issue)
You can switch by running
flutter channel stable