发表日期:2018-08 文章编辑:小灯 浏览次数:2340
bash, mkdir, rm, git, curl, unzip, which
git clone -b beta https://github.com/flutter/flutter.git export PUB_HOSTED_URL=https://pub.flutter-io.cn //国内用户需要设置 export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn //国内用户需要设置 export PATH=`pwd`/flutter/bin:$PATH
1.确定您Flutter SDK的目录,您将在步骤3中用到;
2.在终端打开(或创建) $HOME/.bash_profile. 文件路径和文件名可能在您的机器上不同;
3.添加以下行并更改[PATH_TO_FLUTTER_GIT_DIRECTORY]为克隆Flutter的git repo的路径;
//Android sdk 环境变量配置(没配置的需要配置) export ANDROID_HOME="/Users/geek/Library/Android/sdk"export PATH=${PATH}:${ANDROID_HOME}/tools export PATH=${PATH}:${ANDROID_HOME}/platform-tools//Flutter sdk 环境变量配置 export PUB_HOSTED_URL=https://pub.flutter-io.cn export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn export PATH=/Users/geek/flutter/bin:$PATH //注意说明:geek为我本机的用户名,配置时请替换为你自己本机的用户名;注意确认自己Flutter SDK本机路径;
注意: 由于一些flutter命令需要联网获取数据,如果您是在国内访问,由于众所周知的原因,直接访问很可能不会成功。 上面的PUB_HOSTED_URL和FLUTTER_STORAGE_BASE_URL是google为国内开发者搭建的临时镜像。
//1.刷新当前终端窗口 source $HOME/.bash_profile //2.查看Flutter配置是否已经在PATH环境变量 echo $PATH
sunnydeMacBook-Pro:cache geek$ flutter doctor ╔════════════════════════════════════════════════════════════════════════════╗ ║ WARNING: your installation of Flutter is 74 days old.║ ║║ ║ To update to the latest version, run "flutter upgrade".║ ╚════════════════════════════════════════════════════════════════════════════╝ Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.11.6 15G20015, locale zh-Hans) [!] Android toolchain - develop for Android devices (Android SDK 28.0.2) ! Some Android licenses not accepted.To resolve this, run: flutter doctor --android-licenses [!] iOS toolchain - develop for iOS devices (Xcode 8.2.1) ✗ Flutter requires a minimum Xcode version of 9.0.0. Download the latest version or update via the Mac App Store. ✗ Brew not installed; use this to install tools for iOS device development. Download brew at https://brew.sh/. [✓] Android Studio (version 3.1) [✓] IntelliJ IDEA Ultimate Edition (version 2018.2) [!] Connected devices! Doctor found issues in 3 categories.
sunnydeMacBook-Pro:cache geek$ flutter upgrade Upgrading Flutter from /Users/geek/flutter... From https://github.com/flutter/flutter01d6444..ef71d9dmaster -> origin/master Already up-to-date.Upgrading engine... Already up-to-date.Flutter 0.5.1 • channel beta • https://github.com/flutter/flutter.git Framework • revision c7ea3ca377 (3 months ago) • 2018-05-29 21:07:33 +0200 Engine • revision 1ed25ca7b7 Tools • Dart 2.0.0-dev.58.0.flutter-f981f09760Running flutter doctor... Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.11.6 15G20015, locale zh-Hans) [!] Android toolchain - develop for Android devices (Android SDK 28.0.2) ! Some Android licenses not accepted.To resolve this, run: flutter doctor --android-licenses [!] iOS toolchain - develop for iOS devices (Xcode 8.2.1) ✗ Flutter requires a minimum Xcode version of 9.0.0. Download the latest version or update via the Mac App Store. ✗ Brew not installed; use this to install tools for iOS device development. Download brew at https://brew.sh/. [✓] Android Studio (version 3.1) [✓] IntelliJ IDEA Ultimate Edition (version 2018.2) [!] Connected devices! Doctor found issues in 3 categories.
Waiting for another flutter command to release the startup lock
查了一下github的flutter issue 找到了解决方法,如下:
1、打开flutter的安装目录/bin/cache/ ;
2、删除lockfile文件(rm -rf lockfle);
3、重启AndroidStudio;
重启Android Studio后插件生效.
具体如下图所示:
日期:2018-10 浏览次数:7135
日期:2018-12 浏览次数:4199
日期:2018-07 浏览次数:4757
日期:2018-12 浏览次数:4047
日期:2018-09 浏览次数:5380
日期:2018-12 浏览次数:9795
日期:2018-11 浏览次数:4694
日期:2018-07 浏览次数:4462
日期:2018-05 浏览次数:4744
日期:2018-12 浏览次数:4200
日期:2018-10 浏览次数:5019
日期:2018-12 浏览次数:6091
日期:2018-11 浏览次数:4343
日期:2018-08 浏览次数:4461
日期:2018-11 浏览次数:12485
日期:2018-09 浏览次数:5451
日期:2018-12 浏览次数:4720
日期:2018-10 浏览次数:4060
日期:2018-11 浏览次数:4413
日期:2018-12 浏览次数:5939
日期:2018-06 浏览次数:3884
日期:2018-08 浏览次数:5320
日期:2018-10 浏览次数:4351
日期:2018-12 浏览次数:4358
日期:2018-07 浏览次数:4239
日期:2018-12 浏览次数:4388
日期:2018-06 浏览次数:4265
日期:2018-11 浏览次数:4248
日期:2018-12 浏览次数:4135
日期:2018-12 浏览次数:5155
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.