flutter学习之搭建环境

2019-04-19  本文已影响0人  我叫傻先生
1.下载官方压缩包

https://flutter.io/docs/development/tools/sdk/archive#windows

2.解压到安装目录并添加环境变量
  1. 将安装包zip解压到你想安装Flutter(例如: E:\software) SDK的路径(如:C:\src\flutter;注意,不要将flutter安装到需要一些高权限的路径如C:\Program Files\)。
  2. 打开安装目录E:\software\flutter\bin,将此路径添加到系统环境变量

如果添加了系统环境变量,但是运行flutter run提示flutter不是批处理命令..
重启电脑一次。

3.运行flutter_console.bat

在Flutter安装目录的flutter文件下找到flutter_console.bat,双击运行并启动flutter命令行

4.运行flutter doctor命令,获得以下信息

Doctor summary (to see all details, run flutter doctor -v):
  [√] Flutter (Channel beta, v0.11.3, on Microsoft Windows [Version 10.0.14393], locale zh-CN)
  [!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
  ! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
  [√] Android Studio (version 3.2)X Flutter plugin not installed; this adds Flutter specific functionality.
  X Dart plugin not installed; this adds Dart specific functionality.
  [√] Connected device (1 available)
! Doctor found issues in 1 category.

5.Some Android licenses not accepted.

执行:flutter doctor --android-licenses,需要翻墙

6. Flutter plugin not installed 和 Dart plugin not installed

提示我们 Android Studio 没有安装 Flutter 插件和 Dart 插件,
打开Android Studio安装FlutterDart插件
如果是使用VSCode开发,同样需要安装这两个插件

上一篇下一篇

猜你喜欢

热点阅读