<address id="r9vd9"><address id="r9vd9"><listing id="r9vd9"></listing></address></address>

      歡迎您光臨深圳塔燈網絡科技有限公司!
      電話圖標 余先生:13699882642

      網站百科

      為您解碼網站建設的點點滴滴

      flutter環境配置詳解MAC版

      發表日期:2018-05 文章編輯:小燈 瀏覽次數:2719

      本文詳細介紹在mac下配置flutter環境的每一個步驟,通過圖文的方式使得讀者快速理解和掌握flutter的環境搭建流程。

      下載flutter

      推薦去官網下載,速度并不慢,網址:

      https://flutter.io/setup-macos/

      點擊鏈接:

      image

      筆者在寫這篇文章時候的鏈接為:

      https://storage.googleapis.com/flutter_infra/releases/beta/macos/flutter_macos_v0.3.2-beta.zip

      配置環境變量

      先把剛才下載的flutter_macos_v0.3.2-beta.zip解壓縮,筆者選擇使用的目錄是根目錄下的app文件夾

      image

      配置環境變量,這里筆者使用命令行:

      vim ~/.bash_profile 

      增加一行:

      export PATH=/app/flutter/bin:$PATH 

      保存一下,注意如果這個文件不存在,那么就新建一個。保存完畢之后運行命令:

      source ~/.bash_profile 

      這個時候應該能運行flutter命令了,我們運行命令行:

      flutter -h 

      這個時候應該能展示flutter的命令幫助:

      image

      檢查環境

      運行命令行:

      flutter doctor 
      image

      按照檢測結果的說明,如果有[!] ? 標志,表示本行檢測不通過,需要做一些設置或者安裝一些軟件。

      [!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
      ! Some Android licenses not accepted.To resolve this, run: flutter doctor --android-licens

      需要運行

      flutter doctor --android-licens 
      image

      這里界面會要求輸入Y/N,一路輸入Y就行了。

      ? ideviceinstaller is not installed; this is used to discover connected iOS devices.
      To install, run:
      brew install --HEAD libimobiledevice
      brew install ideviceinstaller
      ? ios-deploy not installed. To install:
      brew install ios-deploy
      ? CocoaPods not installed.
      CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
      Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
      For more info, see https://flutter.io/platform-plugins
      To install:
      brew install cocoapods
      pod setup

      運行命令:

      brew install --HEAD libimobiledevice brew install ideviceinstaller brew install ios-deploy brew install cocoapods pod setup 

      這個步驟有點慢...

      當然讀者看到的也許和筆者不太一致,請酌情處理。

      image

      這里出現了個錯誤,按照說明,運行:

      brew link --overwrite cocoapods 

      然后繼續運行:

      pod setup 

      如果直接運行這個命令,會相當慢,那么我們曲線解決:

      cd ~/.cocoapods/repos git clone https://github.com/CocoaPods/Specs.git 

      如果還是太慢,那么去

      鏈接:https://pan.baidu.com/s/1mQ1VvslwwccdoLRi-I0pNg密碼:lax1

      下一份,解壓縮到~/.cocoapods/repos/master目錄

      [?] Android Studio (version 3.0)
      ? Flutter plugin not installed; this adds Flutter specific functionality.
      ? Dart plugin not installed; this adds Dart specific functionality.

      打開android studio, 打開plugin

      image

      輸入flutter搜索,點擊中間的 Search in repositories

      image

      點擊install,順利的話安裝完畢之后重啟android studio

      再次運行

      flutter doctor 
      image

      注意這里有個坑,如果按照指引來做,會一直卡在這里。這里要先重裝一下python,運行下面的命令:

      brew reinstall python@2 pip install six 

      再次運行

      flutter doctor 

      至此,我們的環境就搭建完畢了,可以愉快的開發了。如果還有疑問,那么可以加入qq群854192563 我們一起探討。


      本頁內容由塔燈網絡科技有限公司通過網絡收集編輯所得,所有資料僅供用戶學習參考,本站不擁有所有權,如您認為本網頁中由涉嫌抄襲的內容,請及時與我們聯系,并提供相關證據,工作人員會在5工作日內聯系您,一經查實,本站立刻刪除侵權內容。本文鏈接:http://www.webpost.com.cn/18048.html
      相關APP開發
       八年  行業經驗

      多一份參考,總有益處

      聯系深圳網站公司塔燈網絡,免費獲得網站建設方案及報價

      咨詢相關問題或預約面談,可以通過以下方式與我們聯系

      業務熱線:余經理:13699882642

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

      国产成人精品综合在线观看