flutter 安装流程

flutter文档

0.安装flutter

https://flutter.cn/docs/get-started/install/windows/desktop?tab=download

1.jdk 安装地址

Java Archive | Oracle

2. android studio 下载地址

https://developer.android.com/studio

3.Visual Studio下载地址

下载 Visual Studio Tools - 免费安装 Windows、Mac、Linux

对于安装 "Desktop development with C++" 工作负载,您应该选择 "使用C++桌面开发" 选项。这个选项涵盖了与桌面开发相关的所有工具和库,包括 C++ 编译器和标准库、Windows SDK、Visual Studio 开发工具等等

4.下载androidSDK

在 android studio sdkManager 去下载

5.android studio 安装 cmdline-tools组件

在 SDK Manager 窗口中,找到 "SDK Tools" 选项卡。在该选项卡下,您应该能够找到 "Android SDK Command-line Tools"(可能也称为 cmdline-tools)。确保此组件已选中,然后单击 "Apply" 或 "OK" 按钮来安装它。

6.Android Studio Unable to find bundled Java version(报错)

Windows:jbr目录内的全部文件复制一份到jre目录

macos: jbr同目录下创建一个jre目录,然后将jbr目录内的全部文件复制一份到jre目录

7.Android toolchain - develop for Android devices (Android SDK version 33.0.3) ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

flutter doctor --android-licenses

8.安装fvm 切换flutter版本
  • 执行以下命令克隆 FVM 仓库:

    git clone https://github.com/leoafarias/fvm.git

  • 进入 FVM 仓库目录:

    cd fvm

  • 执行以下命令来编译并安装 FVM:

    dart pub get

  • dart compile exe bin/fvm.dart -o fvm.exe

  • 手动指定文件路径: 如果 fvm.dart 文件位于不同的目录中,你可以手动指定文件的路径。例如,如果 fvm.dart 文件位于 C:\path\to\your\project\bin 目录中,你可以使用以下命令: dart compile exe C:\path\to\your\project\bin\fvm.dart -o fvm.exe

  • 清理缓存并重新安装依赖项 :有时候,可能是由于 Dart 缓存的问题导致无法正确解析依赖项。你可以尝试清理项目的 Dart 缓存,并重新运行 dart pub get 命令来重新安装依赖项:

dart pub cache clean

dart pub get

  • 清理缓存并重新安装依赖项 :有时候,可能是由于 Dart 缓存的问题导致无法正确解析依赖项。你可以尝试清理项目的 Dart 缓存,并重新运行 dart pub get 命令来重新安装依赖项:

  • 升级dart cmd:

    复制代码
    @"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
  • 清除环境变量缓存:

    refreshenv

相关推荐
唔668 小时前
flutter web iOS 在浏览器加载中文慢的问题
前端·flutter·ios
恋猫de小郭8 小时前
Jetpack Compose 8 月版正式发布,核心模块 1.12
android·前端·flutter
梦想的颜色1 天前
AI 时代小白 VibeCoding 做 APP:UniApp(含 Uni‑X)、Flutter 与 React Native+Expo全维度技术选型对比指南
flutter·react native·app·uniapp·vibecoding·unippx·app产品
坚果的博客1 天前
Flutter-OH 3.44.9-dev 悄然上线|首个 OpenHarmony Canary 预览版上线
flutter
大龄秃头程序员1 天前
Flutter 动画随笔:业务里真正高频的几类控件
flutter
天空之城--1 天前
Android Flutter行业最新动态与实用参考(2026年8月第2周)
android·flutter
恋猫de小郭1 天前
Flutter 3.47 发布,快来看看有什么更新吧
android·前端·flutter
大龄秃头程序员2 天前
一次 Flutter 动画 Demo 的整理与复盘
flutter
AlexMaybeBot2 天前
躺在沙发上开发 Openclaw 的移动端APP
前端·flutter
天空之城--2 天前
Android Flutter行业动态与学习参考(2026年8月)
android·flutter