windows下Flutter环境搭建

  • windows下Flutter环境搭建已关闭评论
  • 8 views
  • A+
所属分类:编程开发

安装和环境配置

flutter下载地址:https://flutter.cn/docs/get-started/install/windows

我这里下载的是最新的flutter_windows_v1.9.1+hotfix.6-stable.zip

下载后,配置环境变量,我是解压到D盘,如下:

windows下Flutter环境搭建

所有环境变量在Path后面添加D:\flutter\bin

国内为 Flutter 设定镜像配置

官网推荐的是

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

所以我们要在系统变量添加这两个变量,如下:

windows下Flutter环境搭建

windows下Flutter环境搭建

安装androidstudio

下载地址:https://developer.android.google.cn/studio,直接下载最新的安装包安装就行。

安装flutter和dart插件

打开android studio,File > Settings > Plugins,选择 Marketplace点击安装Flutter

windows下Flutter环境搭建

下载Android sdk

下载地址:https://www.androiddevtools.cn/

先找到SDK Tools,下载最新的版本即可。选择zip的,解压缩至目标路径位置即可,如下图:

windows下Flutter环境搭建

下载完成后,解压,然后点击SDK Manager.exe更新,如下图:

windows下Flutter环境搭建

更新完成后,配置环境变量。

我这里是d:/sdk,添加ANDROID_HOME,系统变量添加,如下:

windows下Flutter环境搭建

然后在Path中添加%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools

然后安装各个版本的sdk


安装完成后运行
flutter doctor

xub@xub-PC MINGW64 ~/Desktop
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 6.1.7601], locale zh-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
 ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Android Studio (version 3.5)

[!] Connected device
 ! No devices available

! Doctor found issues in 2 categories.

根据上面的提示执行doctor --android-licenses,那么我们就执行以下,如下:

doctor --android-licenses

然后输入y y y..再执行flutter doctor,如下:

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.9.1+hotfix.6, on Microsoft Windows [Version 6.1.7601], locale zh-CN)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 3.5)

[!] Connected device
 ! No devices available

! Doctor found issues in 1 categories.

这个flutter环境就搞定了

  • 安卓客户端下载
  • 微信扫一扫
  • weinxin
  • 微信公众号
  • 微信公众号扫一扫
  • weinxin
avatar