為您解碼網(wǎng)站建設(shè)的點(diǎn)點(diǎn)滴滴
發(fā)表日期:2018-08 文章編輯:小燈 瀏覽次數(shù):2482
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 //國(guó)內(nèi)用戶需要設(shè)置 export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn //國(guó)內(nèi)用戶需要設(shè)置 export PATH=`pwd`/flutter/bin:$PATH
1.確定您Flutter SDK的目錄,您將在步驟3中用到;
2.在終端打開(或創(chuàng)建) $HOME/.bash_profile. 文件路徑和文件名可能在您的機(jī)器上不同;
3.添加以下行并更改[PATH_TO_FLUTTER_GIT_DIRECTORY]為克隆Flutter的git repo的路徑;
//Android sdk 環(huán)境變量配置(沒配置的需要配置) export ANDROID_HOME="/Users/geek/Library/Android/sdk"export PATH=${PATH}:${ANDROID_HOME}/tools export PATH=${PATH}:${ANDROID_HOME}/platform-tools//Flutter sdk 環(huán)境變量配置 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為我本機(jī)的用戶名,配置時(shí)請(qǐng)?zhí)鎿Q為你自己本機(jī)的用戶名;注意確認(rèn)自己Flutter SDK本機(jī)路徑;
注意: 由于一些flutter命令需要聯(lián)網(wǎng)獲取數(shù)據(jù),如果您是在國(guó)內(nèi)訪問,由于眾所周知的原因,直接訪問很可能不會(huì)成功。 上面的PUB_HOSTED_URL和FLUTTER_STORAGE_BASE_URL是google為國(guó)內(nèi)開發(fā)者搭建的臨時(shí)鏡像。
//1.刷新當(dāng)前終端窗口 source $HOME/.bash_profile //2.查看Flutter配置是否已經(jīng)在PATH環(huán)境變量 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 瀏覽次數(shù):7336
日期:2018-12 瀏覽次數(shù):4406
日期:2018-07 瀏覽次數(shù):4942
日期:2018-12 瀏覽次數(shù):4242
日期:2018-09 瀏覽次數(shù):5578
日期:2018-12 瀏覽次數(shù):9994
日期:2018-11 瀏覽次數(shù):4880
日期:2018-07 瀏覽次數(shù):4647
日期:2018-05 瀏覽次數(shù):4929
日期:2018-12 瀏覽次數(shù):4386
日期:2018-10 瀏覽次數(shù):5207
日期:2018-12 瀏覽次數(shù):6280
日期:2018-11 瀏覽次數(shù):4537
日期:2018-08 瀏覽次數(shù):4657
日期:2018-11 瀏覽次數(shù):12719
日期:2018-09 瀏覽次數(shù):5646
日期:2018-12 瀏覽次數(shù):4910
日期:2018-10 瀏覽次數(shù):4252
日期:2018-11 瀏覽次數(shù):4592
日期:2018-12 瀏覽次數(shù):6132
日期:2018-06 瀏覽次數(shù):4074
日期:2018-08 瀏覽次數(shù):5517
日期:2018-10 瀏覽次數(shù):4520
日期:2018-12 瀏覽次數(shù):4606
日期:2018-07 瀏覽次數(shù):4434
日期:2018-12 瀏覽次數(shù):4573
日期:2018-06 瀏覽次數(shù):4464
日期:2018-11 瀏覽次數(shù):4443
日期:2018-12 瀏覽次數(shù):4321
日期:2018-12 瀏覽次數(shù):5348
Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.