Repository: flutter
Issue: Unable to run a new project automatically created by Flutter: MSB8066 --> FormatException: Missing extension byte (at offset 5)
Labels: c: crash,tool,a: internationalization,platform-windows,t: flutter doctor,a: desktop,P2,team-windows,triaged-windows

### Steps to reproduce

I have just started working with Flutter, and I ensured that I installed Visual Studio 2022 and the C++dependency package based on desktop development according to the official Windows desktop program guidelines. Then, I created a new project using Flutter, and then tried to run the program. I did not make any changes to the code before running, but I was unable to run it successfully.

My operating system is Windows 10 Home Chinese version.

I have tried my best to search online for people who have encountered similar situations as me, but I have never found a solution. The most fundamental mistake I believe is the following:

```console

[ +562 ms]   Unhandled exception:
[  +19 ms]   FormatException: Missing extension byte (at offset 5)
[   +7 ms]   #0      _Utf8Decoder.convertChunked (dart:convert-patch/convert_patch.dart:1852:7)

```

### Actual results

This is the actual output of running "Flutter Run":

```console
PS E:\Projects\flutter_application_2> flutter run -d windows
系统找不到指定的路径。
系统找不到指定的路径。
Launching lib\main.dart on Windows in debug mode...
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(249,5): error MSB8066: ��E:\Projects\flutter_application_2\build\windows\x64\CMakeFiles\2ed923eafaebe29461ff6ed361128388\flutter_windows.dll.rule;E:\Projects\flutter_application_2\build\windows\x64\CMakeFiles\01329f928cd772bf747eb4aa894b26d4\flutter_assemble.rule�����Զ����������˳�������Ϊ 255�� [E:\Projects\flutter_application_2\build\windows\x64\flutter\flutter_assemble.vcxproj]
Building Windows application...                                     3.8s
Exception: Build process failed.
PS E:\Projects\flutter_application_2> 
```

### Logs

<details open>
<summary>flutter doctor</summary>

```console

PS E:\Projects\flutter_application_2> flutter run -d windows -v
系统找不到指定的路径。
系统找不到指定的路径。
[ +320 ms] Unable to locate an Android SDK.
[ +162 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[   +7 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +93 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[  +13 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +3 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +146 ms] Skipping pub get: version match.
[ +303 ms] Generating E:\Projects\flutter_application_2\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[ +201 ms] Initializing file store
[  +21 ms] Skipping target: gen_localizations
[  +10 ms] gen_dart_plugin_registrant: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated       
contents: E:\Projects\flutter_application_2\.dart_tool\package_config_subset}
[  +68 ms] gen_dart_plugin_registrant: Complete
[   +4 ms] Skipping target: _composite
[   +5 ms] complete
[  +11 ms] Launching lib\main.dart on Windows in debug mode...
[   +6 ms] E:\Projects\javas\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev
E:\Projects\javas\flutter\bin\cache\dart-sdk\bin\snapshots\frontend_server.dart.snapshot --sdk-root
E:\Projects\javas\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter
--experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true
-DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/3f3e560236539b7e2702f5ac790b2a4691b32d49/ --output-dill       
C:\Users\kty\AppData\Local\Temp\flutter_tools.f5ad363e\flutter_tool.a8cb358d\app.dill --packages
E:\Projects\flutter_application_2\.dart_tool\package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts   
--track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill
build\dd704641fca0f13458e044aee43be5d8.cache.dill.track.dill --verbosity=error --enable-experiment=alternative-invalidation-strategy[  +52 ms] executing: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -format json -products * -utf8 -latest
-version 16 -requires Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Component.VC.Tools.x86.x64
Microsoft.VisualStudio.Component.VC.CMake.Project
[  +71 ms] Exit code 0 from: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe -format json -products * -utf8
-latest -version 16 -requires Microsoft.VisualStudio.Workload.NativeDesktop Microsoft.VisualStudio.Component.VC.Tools.x86.x64       
Microsoft.VisualStudio.Component.VC.CMake.Project
[   +1 ms] [
             {
               "instanceId": "03cae30e",
               "installDate": "2023-09-28T08:53:45Z",
               "installationName": "VisualStudio/17.7.4+34031.279",
               "installationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community",
               "installationVersion": "17.7.34031.279",
               "productId": "Microsoft.VisualStudio.Product.Community",
               "productPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Common7\\IDE\\devenv.exe",
               "state": 4294967295,
               "isComplete": true,
               "isLaunchable": true,
               "isPrerelease": false,
               "isRebootRequired": false,
               "displayName": "Visual Studio Community 2022",
               "description": "功能强大的 IDE，供学生、开放源代码参与者和个人免费使用",
               "channelId": "VisualStudio.17.Release",
               "channelUri": "https://aka.ms/vs/17/release/channel",
               "enginePath": "C:\\Program Files (x86)\\Microsoft Visual
               Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
               "installedChannelId": "VisualStudio.17.Release",
               "installedChannelUri": "https://aka.ms/vs/17/release/channel",
               "releaseNotes": "https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.7#17.7.4",
               "resolvedInstallationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community",
               "thirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=661288",
               "updateDate": "2023-09-28T08:53:45.7760682Z",
               "catalog": {
                 "buildBranch": "d17.7",
                 "buildVersion": "17.7.34031.279",
                 "id": "VisualStudio/17.7.4+34031.279",
                 "localBuild": "build-lab",
                 "manifestName": "VisualStudio",
                 "manifestType": "installer",
                 "productDisplayVersion": "17.7.4",
                 "productLine": "Dev17",
                 "productLineVersion": "2022",
                 "productMilestone": "RTW",
                 "productMilestoneIsPreRelease": "False",
                 "productName": "Visual Studio",
                 "productPatchVersion": "4",
                 "productPreReleaseMilestoneSuffix": "1.0",
                 "productSemanticVersion": "17.7.4+34031.279",
                 "requiredEngineVersion": "3.7.2181.36443"
               },
               "properties": {
                 "campaignId": "2030:9bb00214872f46f3b74fb4d928155574",
                 "channelManifestId": "VisualStudio.17.Release/17.7.4+34031.279",
                 "nickname": "",
                 "setupEngineFilePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\setup.exe"
               }
             }
           ]
[  +23 ms] Building Windows application...
[  +11 ms] <- compile package:flutter_application_2/main.dart
[   +2 ms] executing: C:\Program Files\Microsoft Visual
Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe -S E:\Projects\flutter_application_2\windows 
-B build\windows\x64 -G Visual Studio 17 2022 -A x64 -DFLUTTER_TARGET_PLATFORM=windows-x64
[ +103 ms] -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
[  +30 ms] -- Configuring done (0.0s)
[ +356 ms] -- Generating done (0.3s)
[  +29 ms] -- Build files have been written to: E:/Projects/flutter_application_2/build/windows/x64
[  +11 ms] executing: C:\Program Files\Microsoft Visual
Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe --build build\windows\x64 --config Debug     
--target INSTALL --verbose
[ +206 ms] ������ .NET Framework MSBuild �汾 17.7.2+d6990bcfa
[  +82 ms] ��������ʱ��Ϊ 2024/1/10 18:09:57��
[ +420 ms] �ڵ� 1 �ϵ���Ŀ��E:\Projects\flutter_application_2\build\windows\x64\INSTALL.vcxproj��(Ĭ��Ŀ��)��
[  +13 ms] ��Ŀ��E:\Projects\flutter_application_2\build\windows\x64\INSTALL.vcxproj��(1)���ڽڵ� 1
�����ɡ�E:\Projects\flutter_application_2\build\windows\x64\ZERO_CHECK.vcxproj��(2) (Ĭ��Ŀ��)��
[   +8 ms] InitializeBuildStatus:
[   +2 ms]   ���ڴ�����x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild������Ϊ��ָ����AlwaysCreate����
[   +3 ms]   ���ڶԡ�x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild��ִ�� Touch ����
[  +32 ms] CustomBuild:
[        ]   ���������Ϊ���¡�
[  +95 ms] FinalizeBuildStatus:
[        ]   ����ɾ���ļ���x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild����
[   +9 ms]   ���ڶԡ�x64\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate��ִ�� Touch ����
[   +2 ms] �����������Ŀ��E:\Projects\flutter_application_2\build\windows\x64\ZERO_CHECK.vcxproj��(Ĭ��Ŀ��)�Ĳ�����
[ +139 ms] ��Ŀ��E:\Projects\flutter_application_2\build\windows\x64\INSTALL.vcxproj��(1)���ڽڵ� 1
�����ɡ�E:\Projects\flutter_application_2\build\windows\x64\ALL_BUILD.vcxproj��(3) (Ĭ��Ŀ��)��
[   +1 ms] ��Ŀ��E:\Projects\flutter_application_2\build\windows\x64\ALL_BUILD.vcxproj��(3)���ڽڵ� 1
�����ɡ�E:\Projects\flutter_application_2\build\windows\x64\runner\flutter_application_2.vcxproj��(4) (Ĭ��Ŀ��)��
[   +4 ms] ��Ŀ��E:\Projects\flutter_application_2\build\windows\x64\runner\flutter_application_2.vcxproj��(4)���ڽڵ� 1
�����ɡ�E:\Projects\flutter_application_2\build\windows\x64\flutter\flutter_assemble.vcxproj��(5) (Ĭ��Ŀ��)��
[   +3 ms] InitializeBuildStatus:
[   +3 ms]   ���ڶԡ�x64\Debug\flutter_assemble\flutter_assemble.tlog\unsuccessfulbuild��ִ�� Touch ����
[   +4 ms] CustomBuild:
[        ]
����E:\Projects\flutter_application_2\build\windows\x64\CMakeFiles\01329f928cd772bf747eb4aa894b26d4\flutter_assemble.rule���������������ɡ�E:\Projects\flutter_application_2\build\windows\x64\CMakeFiles\2ed923eafaebe29461ff6ed361128388\flutter_windows.dll.rule���������������ġ�E:\PROJECTS\FLUTTER_APPLICATION_2\WINDOWS\FLUTTER\EPHEMERAL\FLUTTER_WINDOWS.DLL�����޷������������
[ +218 ms]   Generating E:/Projects/flutter_application_2/windows/flutter/ephemeral/flutter_windows.dll,
E:/Projects/flutter_application_2/windows/flutter/ephemeral/flutter_export.h,
E:/Projects/flutter_application_2/windows/flutter/ephemeral/flutter_windows.h,
E:/Projects/flutter_application_2/windows/flutter/ephemeral/flutter_messenger.h,
E:/Projects/flutter_application_2/windows/flutter/ephemeral/flutter_plugin_registrar.h,
E:/Projects/flutter_application_2/windows/flutter/ephemeral/flutter_texture_registrar.h,
E:/Projects/flutter_application_2/windows/flutter/ephemeral/cpp_client_wrapper/core_implementations.cc,
E:/Projects/flutter_application_2/windows/flutter/ephemeral/cpp_client_wrapper/standard_codec.cc,
E:/Projects/flutter_application_2/windows/flutter/ephemeral/cpp_client_wrapper/plugin_registrar.cc,
E:/Projects/flutter_application_2/windows/flutter/ephemeral/cpp_client_wrapper/flutter_engine.cc,
E:/Projects/flutter_application_2/windows/flutter/ephemeral/cpp_client_wrapper/flutter_view_controller.cc, _phony_
[  +62 ms]   ϵͳ�Ҳ���ָ����·����
[ +562 ms]   Unhandled exception:
[  +19 ms]   FormatException: Missing extension byte (at offset 5)
[   +7 ms]   #0      _Utf8Decoder.convertChunked (dart:convert-patch/convert_patch.dart:1852:7)
[   +6 ms]   #1      _Utf8ConversionSink.addSlice (dart:convert/string_conversion.dart:304:28)
[   +3 ms]   #2      _Utf8ConversionSink.add (dart:convert/string_conversion.dart:300:5)
[        ]   #3      _ConverterStreamEventSink.add (dart:convert/chunked_conversion.dart:69:18)
[   +1 ms]   #4      _SinkTransformerStreamSubscription._handleData (dart:async/stream_transformers.dart:111:24)
[   +4 ms]   #5      _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
[   +8 ms]   #6      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
[   +2 ms]   #7      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
[        ]   #8      _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
[   +1 ms]   #9      _StreamController._add (dart:async/stream_controller.dart:658:7)
[   +4 ms]   #10     _StreamController.add (dart:async/stream_controller.dart:606:5)
[   +1 ms]   #11     _Socket._onData (dart:io-patch/socket_patch.dart:2447:41)
[   +1 ms]   #12     _RootZone.runUnaryGuarded (dart:async/zone.dart:1594:10)
[   +4 ms]   #13     _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:339:11)
[   +1 ms]   #14     _BufferingStreamSubscription._add (dart:async/stream_impl.dart:271:7)
[   +1 ms]   #15     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:784:19)
[   +1 ms]   #16     _StreamController._add (dart:async/stream_controller.dart:658:7)
[   +2 ms]   #17     _StreamController.add (dart:async/stream_controller.dart:606:5)
[   +2 ms]   #18     new _RawSocket.<anonymous closure> (dart:io-patch/socket_patch.dart:1936:33)
[   +3 ms]   #19     _NativeSocket.issueReadEvent.issue (dart:io-patch/socket_patch.dart:1379:14)
[  +24 ms]   #20     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
[  +16 ms]   #21     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)
[   +2 ms]   #22     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
[   +4 ms]   #23     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:185:5)
[   +6 ms] C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(249,5):
error MSB8066:
��E:\Projects\flutter_application_2\build\windows\x64\CMakeFiles\2ed923eafaebe29461ff6ed361128388\flutter_windows.dll.rule;E:\Projects\flutter_application_2\build\windows\x64\CMakeFiles\01329f928cd772bf747eb4aa894b26d4\flutter_assemble.rule�����Զ����������˳�������Ϊ 255�� [E:\Projects\flutter_application_2\build\windows\x64\flutter\flutter_assemble.vcxproj]
[  +23 ms] �����������Ŀ��E:\Projects\flutter_application_2\build\windows\x64\flutter\flutter_assemble.vcxproj��(Ĭ��Ŀ��)�Ĳ��� - ʧ�ܡ�
[  +12 ms] �����������Ŀ��E:\Projects\flutter_application_2\build\windows\x64\runner\flutter_application_2.vcxproj��(Ĭ��Ŀ��)�Ĳ��� -
ʧ�ܡ�
[  +86 ms] �����������Ŀ��E:\Projects\flutter_application_2\build\windows\x64\ALL_BUILD.vcxproj��(Ĭ��Ŀ��)�Ĳ��� - ʧ�ܡ�
[   +7 ms] �����������Ŀ��E:\Projects\flutter_application_2\build\windows\x64\INSTALL.vcxproj��(Ĭ��Ŀ��)�Ĳ��� - ʧ�ܡ�
[  +17 ms] ����ʧ�ܡ�
[        ] ��E:\Projects\flutter_application_2\build\windows\x64\INSTALL.vcxproj��(Ĭ��Ŀ��) (1) ->
[        ] ��E:\Projects\flutter_application_2\build\windows\x64\ALL_BUILD.vcxproj��(Ĭ��Ŀ��) (3) ->
[        ] ��E:\Projects\flutter_application_2\build\windows\x64\runner\flutter_application_2.vcxproj��(Ĭ��Ŀ��) (4) ->
[        ] ��E:\Projects\flutter_application_2\build\windows\x64\flutter\flutter_assemble.vcxproj��(Ĭ��Ŀ��) (5) ->
[  +31 ms] (CustomBuild Ŀ��) -> 
[   +1 ms]   C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(249,5):
error MSB8066:
��E:\Projects\flutter_application_2\build\windows\x64\CMakeFiles\2ed923eafaebe29461ff6ed361128388\flutter_windows.dll.rule;E:\Projects\flutter_application_2\build\windows\x64\CMakeFiles\01329f928cd772bf747eb4aa894b26d4\flutter_assemble.rule�����Զ����������˳�������Ϊ 255�� [E:\Projects\flutter_application_2\build\windows\x64\flutter\flutter_assemble.vcxproj]
[  +11 ms]     0 ������
[   +2 ms]     1 ������
[        ] ����ʱ�� 00:00:01.87
[  +47 ms] Building Windows application... (completed in 2,789ms)
[+11735 ms] Exception: Build process failed.
[  +12 ms] "flutter run" took 15,643ms.
[   +4 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:752:9)
           <asynchronous suspension>
           #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1350:27)
           <asynchronous suspension>
           #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #4      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
           <asynchronous suspension>
           #5      FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:348:9)
           <asynchronous suspension>
           #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:294:5)
           <asynchronous suspension>
           #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:112:9)
           <asynchronous suspension>
           #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #10     main (package:flutter_tools/executable.dart:90:3)
           <asynchronous suspension>


[  +33 ms] ensureAnalyticsSent: 18ms
[   +1 ms] Running 1 shutdown hook
[  +17 ms] Shutdown hooks complete
[        ] exiting with code 1
PS E:\Projects\flutter_application_2> 

```

</details>


### Flutter Doctor output

<details open>
<summary>flutter doctor</summary>

```console

PS E:\Projects\flutter_application_2> flutter doctor
系统找不到指定的路径。
系统找不到指定的路径。
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.16.5, on Windows, locale zh-CN)
[X] Windows Version (Unable to determine Windows version (command `ver` returned Windows))
[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.7.4)
[!] Android Studio (not installed)
[√] Connected device (3 available)
[√] Network resources

! Doctor found issues in 3 categories.
PS E:\Projects\flutter_application_2> 

```

</details>

**I don't know why, Flutter Doctor can't get the version of my Windows system.**

**I don't need to develop an Android platform, so I didn't install the Android environment.**