当前位置: 首页 > news >正文

flutter安装各种问题汇总

C:\Users\Administrator>flutter doctor -v
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
[√] Flutter (Channel stable, 3.7.0, on Microsoft Windows [版本 10.0.19044.1826], locale zh-CN)
    • Flutter version 3.7.0 on channel stable at D:\soft_install\flutter_windows_3.7.0-stable\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b06b8b2710 (9 weeks ago), 2023-01-23 16:55:55 -0800
    • Engine revision b24591ed32
    • Dart version 2.19.0
    • DevTools version 2.20.1
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[X] Windows Version (Unable to confirm if installed Windows version is 10 or greater)

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at D:\soft_install\Android\Sdk
    • Platform android-33, build-tools 33.0.2
    • ANDROID_HOME = D:\soft_install\Android\Sdk
解决 设置环境变量SDK安装文件夹
    • Java binary at: D:\soft_install\Android\Android Studio4-1\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
运行失败的话,gui界面的sdk 下载cmdline-tools,降低版本到8.0
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • CHROME_EXECUTABLE = C:\Users\Administrator\AppData\Local\Google Chrome\Chromebin\chrome.exe

[X] Visual Studio - develop for Windows
    X Visual Studio not installed; this is necessary for Windows development.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 4.1)
    • Android Studio at D:\soft_install\Android\Android Studio4-1
解决方法,先到gui界面的sdk 下载cmdline-tools工具,会自动下载到D:\soft_install\Android\Sdk\cmdline-tools
(1)配置Android studio的命令:flutter config --android-studio-dir=“D:\software\Android Studio\studio”
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] Connected device (2 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [版本 10.0.19044.1826]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 89.0.4389.90

[√] HTTP Host Availability
    • All required HTTP hosts are available
问题http
解决:
删除缓存 :Flutter SDK路径/flutter/bin/cache
进入
Flutter SDK路径/flutter/packages/flutter_tools/lib/src/http_host_validator.dart


/// Android specific required HTTP hosts.
List<String> androidRequiredHttpHosts(Platform platform) {
  return <String>[
    // If kEnvCloudUrl is set, it will be used as the maven host
    if (!platform.environment.containsKey(kEnvCloudUrl))
      'https://maven.google.com',
  ];
}
改成:


/// Android specific required HTTP hosts.
List<String> androidRequiredHttpHosts(Platform platform) {
  return <String>[
    // If kEnvCloudUrl is set, it will be used as the maven host
    if (!platform.environment.containsKey(kEnvCloudUrl))
      'https://dl.google.com/dl/',
  ];
}
再将 kPubDevHttpHost 和 kgCloudHttpHost 两个常量 分别修改为 https://pub.flutter-io.cn/ 和 https://storage.flutter-io.cn/(解决第二个)

const String kPubDevHttpHost = 'https://pub.flutter-io.cn/';
const String kgCloudHttpHost = 'https://storage.flutter-io.cn/';

 
链接:https://www.jianshu.com/p/d1a923b9d298
 

http://www.lryc.cn/news/45603.html

相关文章:

  • 网络传输层
  • linux内核启动分析(二)
  • 『EasyNotice』.NET开源消息通知组件——快速实现邮件/钉钉告警通知
  • JVM垃圾回收算法
  • 怎么看待ChatGPT封号这件事呢?
  • 八、交换技术原理
  • 什么是DHCP?DHCP有什么用?(中科三方)
  • 算法设计-二分
  • 隧道技术基础
  • 卡尔曼滤波浅析
  • Eolink Apikit 创建/生成 API 文档
  • 2023年上半年系统分析师备考法则
  • 【人工智能】—约束传播、弧约束、问题结果与问题分解、局部搜索CSP
  • Java设计模式面试专题
  • 文件(下)——“C”
  • bugku 渗透靶场3
  • NER 任务以及联合提槽任务
  • scala函数式编程
  • 网吧2023:热闹回来了,电竞战歌起
  • 代码随想录算法训练营第五十九天|503.下一个更大元素II、42. 接雨水
  • 9、简单功能分析
  • 如何发送和接收参数?五种参数传递方法
  • 蓝桥杯C/C++VIP试题每日一练之矩形面积交
  • Spark大数据处理讲课笔记2.4 IDEA开发词频统计项目
  • 【ChatGPT 】国内无需注册 openai 即可访问 ChatGPT:ChatGPT Sidebar 浏览器扩展程序的安装与使用
  • 使用fetch()异步请求API数据实现汇率转换器
  • GPT-4“王炸”,10秒钟开发一套Web + APP 系统
  • Disjoint 集合数据结构或 Union-Find 算法简介
  • uniapp中nvue与vue的区别?
  • 带头双向循环链表的实现