FLUTTER环境搭建

  1. 下载Flutter SDK:
    Git命令下载:git clone -b beta https://github.com/flutter/flutter.git
    官网下载(需翻墙):https://flutter.dev/docs/get-started/install/windows

  2. Flutter 环境配置

系统变量:
PUB_HOSTED_URL=https://pub.flutter-io.cn
FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
path:C:\MyTools\flutter\bin  (flutter安装包bin的全路径)
  1. Android SDK 下载和配置(另外JDK自行配置,此处不做说明)
    官网(需翻墙):(http://developer.android.com/sdk/index.html)
    无需翻墙:http://www.androiddevtools.cn/
系统变量:
ANDROID_HOME=C:\MyTools\android-sdk-windows  (android安装包的全路径)
path: %ANDROID_HOME%\tools;
path: %ANDROID_HOME%\platform-tools
  1. 运行flutter doctor,报错了
问题解决
从报错提示来看,需要添加Android license
    执行命令:flutter doctor --android-licenses(若还报错,替换下android的tools即可)
    当提示是否接受许可时,一路输入y确认即可,如下:
    Review licenses that have not been accepted (y/N)? y
    All SDK package licenses accepted
在执行flutter doctor

至此,就可以愉快的撸码了

你可能感兴趣的:(FLUTTER环境搭建)