flutter 运行windows项目时报错 Bad UTF-8 encoding (U+FFFD; REPLACEMENT CHARACTER)

flutter工程在windows平台运行时,可能会报错Bad UTF-8 encoding (U+FFFD; REPLACEMENT CHARACTER) found while decoding string,字意上是字符集编码不正确,可是更改visualstudio字符集为utif-8后,还是会报错,无奈查看github issues才得以解决,这里记录下。

问题讨论:
[windows] Exception: Bad UTF-8 encoding when running flutter doctor or building/running for Windows · Issue #102451 · flutter/flutter (github.com)

根据歪果仁的讨论内容,分析应该是VisualStudio的bug。

解决方案:

Temporary solution: Replace the vswhere.exe in the C:\Program Files (x86)\Microsoft Visual Studio\Installer with the latest version: https://github.com/microsoft/vswhere/releases

根据链接下载vswhere.exe,替换本地c盘目录下的这个exe即可解决。

你可能感兴趣的:(flutter 运行windows项目时报错 Bad UTF-8 encoding (U+FFFD; REPLACEMENT CHARACTER))