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

相关推荐
WDeLiang1 小时前
Flutter - UIKit开发相关指南 - 导航
flutter·ios·dart
程序猿阿伟7 小时前
《Flutter社交应用暗黑奥秘:模式适配与色彩的艺术》
前端·flutter
融云15 小时前
集成指南:如何采用融云 Flutter IMKit 实现双端丝滑社交体验
flutter
EndingCoder1 天前
跨平台移动开发框架React Native和Flutter性能对比
flutter·react native·react.js
Double Point1 天前
`RotationTransition` 是 Flutter 中的一个动画组件,用于实现旋转动画效果
flutter
亚洲小炫风1 天前
flutter 项目工程文件夹组织结构
flutter·flutter工程结构
Double Point1 天前
Flutter 中 vsync
flutter
Double Point1 天前
ScaleTransition 是 Flutter 中的一个动画组件,用于实现缩放动画效果。
flutter
saxihuangxing1 天前
flutter build apk出现的一些奇怪的编译错误
flutter
恋猫de小郭2 天前
Flutter 合并 ‘dot-shorthands‘ 语法糖,Dart 开始支持交叉编译
android·flutter·ios