国产亚洲欧美人成在线,免费视频爱爱太爽了无码,日本免费一区二区三区高清视频 ,国产真实伦对白精彩视频

歡迎您光臨深圳塔燈網(wǎng)絡(luò)科技有限公司!
電話圖標(biāo) 余先生:13699882642

網(wǎng)站百科

為您解碼網(wǎng)站建設(shè)的點(diǎn)點(diǎn)滴滴

Mac OS Flutter環(huán)境配置詳解

發(fā)表日期:2018-08 文章編輯:小燈 瀏覽次數(shù):2482

系統(tǒng)要求

要安裝并運(yùn)行Flutter,您的開發(fā)環(huán)境必須滿足以下最低要求:
  • 操作系統(tǒng): macOS (64-bit);
  • 磁盤空間: 700 MB (不包括Xcode或Android Studio的磁盤空間);
  • 工具: Flutter 依賴下面這些命令行工具;

bash, mkdir, rm, git, curl, unzip, which

獲取Flutter SDK

要獲得Flutter,請(qǐng)先使用git克隆Flutter,然后將該flutter工具添加到您的用戶路徑。
如果這是您第一次在此機(jī)器上安裝Flutter,請(qǐng)克隆beta分支,然后將該flutter工具添加到您的系統(tǒng)路徑中:
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 
注意: 以上配置命令為當(dāng)前終端窗口臨時(shí)設(shè)置PATH變量,你會(huì)發(fā)現(xiàn)系統(tǒng)重新啟動(dòng)后配置的PATH變量丟失,在終端執(zhí)行flutter doctor 提示command not found 。所以我們要將Flutter PATH環(huán)境變量永久添加到系統(tǒng)路徑中,以便可以運(yùn)行flutter命令在任何終端會(huì)話中。
具體步驟如下:

1.確定您Flutter SDK的目錄,您將在步驟3中用到;
2.在終端打開(或創(chuàng)建) $HOME/.bash_profile. 文件路徑和文件名可能在您的機(jī)器上不同;
3.添加以下行并更改[PATH_TO_FLUTTER_GIT_DIRECTORY]為克隆Flutter的git repo的路徑;

下面貼一個(gè)筆者本機(jī)(mac)的環(huán)境變量配置
//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í)鏡像。

以上配置完成后執(zhí)行以下命令:
//1.刷新當(dāng)前終端窗口 source $HOME/.bash_profile //2.查看Flutter配置是否已經(jīng)在PATH環(huán)境變量 echo $PATH 
運(yùn)行 flutter doctor 顯示您可能需要安裝的剩余依賴項(xiàng)
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. 
一般的錯(cuò)誤會(huì)是xcode或Android Studio版本太低、或者沒有ANDROID_HOME環(huán)境變量等,請(qǐng)按照提示解決。本機(jī)執(zhí)行flutter doctor命令后提示老版本,需更新至最新版本;

更新Flutter SDK 至最新版本

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. 
遇到打開Android Studio的時(shí)候頂部的模擬器一直是loading狀態(tài),即使已經(jīng)打開了模擬器。 運(yùn)行flutter doctor 提示如下:
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配置Flutter環(huán)境

  • 啟動(dòng)Android Studio.
  • 打開插件首選項(xiàng) (Preferences>Plugins on macOS,File>Settings>Plugins on Windows & Linux).
  • 選擇 Browse repositories…, 選擇 Flutter 插件并點(diǎn)擊 install.
  • 重啟Android Studio后插件生效.
    具體如下圖所示:


    1.png

配置Flutter SDK路徑

2.png

配置Dart SDK路徑

3.png

創(chuàng)建Flutter 工程

首次創(chuàng)建Flutter工程可能會(huì)有一個(gè)漫長(zhǎng)的等待過程
4.png

完美運(yùn)行第一個(gè)Flutter應(yīng)用

調(diào)試狀態(tài)下運(yùn)行應(yīng)用啟動(dòng)后右上角會(huì)有一個(gè)DEBUG的標(biāo)志
WechatIMG84.jpeg
總結(jié):配置Flutter的過程配置了兩次,第一次配置是在當(dāng)前終端窗口臨時(shí)設(shè)置PATH變量,系統(tǒng)重啟后配置丟失了,執(zhí)行flutter doctor,提示命令無效,打開Android Studio創(chuàng)建Flutter工程一直漫長(zhǎng)的等待,就想著是否哪里配置有問題。就又慮一遍配置細(xì)節(jié),終于配置完成。以上是所有配置過程,希望能幫到你。

本頁內(nèi)容由塔燈網(wǎng)絡(luò)科技有限公司通過網(wǎng)絡(luò)收集編輯所得,所有資料僅供用戶學(xué)習(xí)參考,本站不擁有所有權(quán),如您認(rèn)為本網(wǎng)頁中由涉嫌抄襲的內(nèi)容,請(qǐng)及時(shí)與我們聯(lián)系,并提供相關(guān)證據(jù),工作人員會(huì)在5工作日內(nèi)聯(lián)系您,一經(jīng)查實(shí),本站立刻刪除侵權(quán)內(nèi)容。本文鏈接:http://jstctz.cn/18162.html
相關(guān)APP開發(fā)
 八年  行業(yè)經(jīng)驗(yàn)

多一份參考,總有益處

聯(lián)系深圳網(wǎng)站公司塔燈網(wǎng)絡(luò),免費(fèi)獲得網(wǎng)站建設(shè)方案及報(bào)價(jià)

咨詢相關(guān)問題或預(yù)約面談,可以通過以下方式與我們聯(lián)系

業(yè)務(wù)熱線:余經(jīng)理:13699882642

Copyright ? 2013-2018 Tadeng NetWork Technology Co., LTD. All Rights Reserved.