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

相关推荐
lqj_本人10 小时前
flutter_鸿蒙next_Dart基础②List
flutter
lqj_本人11 小时前
flutter_鸿蒙next_Dart基础①字符串
flutter
The_tuber_sadness11 小时前
【Flutter】- 基础语法
flutter
helloxmg12 小时前
鸿蒙harmonyos next flutter通信之BasicMessageChannel获取app版本号
flutter
linpengteng1 天前
使用 Flutter 开发数字钱包应用(Dompet App)
前端·flutter·firebase
云兮Coder1 天前
鸿蒙 HarmonyNext 与 Flutter 的异同之处
flutter·华为·harmonyos
lqj_本人2 天前
flutter_鸿蒙next(win)环境搭建
flutter·华为·harmonyos
yuanlaile2 天前
Windows上面搭建Flutter Android运行环境
android·flutter