解决Windows10安装Flutter3.16.1遇到的问题

问题描述

C:\Users\Administrator>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[] Flutter (Channel stable, 3.16.1, on Microsoft Windows [版本 10.0.18363.592], locale zh-CN)
[] Windows Version (Installed version of Windows is version 10 or higher)
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    X cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[] Android Studio (version 2022.3)
[] IntelliJ IDEA Ultimate Edition (version 2023.2)
[] Connected device (3 available)
[!] Network resources
    X A cryptographic error occurred while checking "https://storage.googleapis.com/": Connection terminated during
      handshake
      You may be experiencing a man-in-the-middle attack, your network may be compromised, or you may have malware
      installed on your computer.
    X A network error occurred while checking "https://maven.google.com/": 信号灯超时时间已到


! Doctor found issues in 3 categories.

解决办法

问题1:cmdline-tools component is missing

安装Android SDK Command-line Tools(latest)
File -> Settings -> Preferences -> Appearance & behavior -> System Settings (dropdown) -> AndroidSDK->SDK Tools ->Android SDK Command-line Tools (latest)-> Apply

问题2:Android license status unknown.

执行命令

flutter doctor --android-licenses

问题3:Visual Studio not installed; this is necessary to develop Windows apps.

安装 vs
根据Windows的版本选择对应的Visual Studio版本下载
https://visualstudio.microsoft.com/zh-hans/downloads/

问题4:A network error occurred while checking “https://maven.google.com/”: 信号灯超时时间已到

修改文件D:\dev\flutter\packages\flutter_tools\lib\src\http_host_validator.dart中的const String kMaven = 'https://maven.google.com/';const String kMaven = 'https://maven.aliyun.com/repository/google/';

问题5:A cryptographic error occurred while checking “https://storage.googleapis.com/”: Connection terminated during handshake

  1. 添加环境变量
    在用户变量中新增两个变量如下:
PUB_HOSTED_URL  设置为  https://pub.flutter-io.cn
FLUTTER_STORAGE_BASE_URL  设置为  https://storage.flutter-io.cn
  1. 设置代理
set HTTP_PROXY=http://127.0.0.1:7890
set HTTPS_PROXY=http://127.0.0.1:7890
set NO_PROXY=localhost,127.0.0.1,::1

设置代理的方式仅对当前命令提示符窗口有效,关闭窗口失效

重新检测

C:\Users\Administrator>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[] Flutter (Channel stable, 3.16.1, on Microsoft Windows [版本 10.0.18363.592], locale zh-CN)
[] Windows Version (Installed version of Windows is version 10 or higher)
[] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[] Chrome - develop for the web
[] Visual Studio - develop Windows apps (Visual Studio Community 2019 16.11.32)
[] Android Studio (version 2022.3)
[] IntelliJ IDEA Ultimate Edition (version 2023.2)
[] Proxy Configuration
[] Connected device (3 available)
[] Network resources

• No issues found!

参考

https://flutter.cn/docs/get-started/install/windows
https://github.com/flutter/flutter/issues/24854#issuecomment-525105693

  • 10
    点赞
  • 13
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值