安裝步驟見官網(wǎng),中文官網(wǎng)。 github地址
一. 如果你是download的release包,運(yùn)行flutter doctor會(huì)報(bào)如下錯(cuò)誤:
Error: The Flutter directory is not a clone of the GitHub project.
The flutter tool requires Git in order to operate properly;
to set up Flutter, run the following command:
git clone -b beta https://github.com/flutter/flutter.git
解決方案:
- 在flutter目錄執(zhí)行
git init。不推薦 -
git clone https://github.com/flutter/flutter.git或者按官方推薦git clone -b beta https://github.com/flutter/flutter.git使用beta分支。
二、安裝中文版教程中安裝iOS設(shè)備的工具時(shí)會(huì)報(bào)錯(cuò):
checking pkg-config is at least version 0.9.0... yes checking for libusbmuxd >= 1.1.0... no configure: error: Package requirements (libusbmuxd >= 1.1.0) were not met:
Requested 'libusbmuxd >= 1.1.0' but version of libusbmuxd is 1.0.10
解決方案在英文版中已經(jīng)提供:
brew update
# The following two steps are a temporary workaround to https://github.com/flutter/flutter/issues/22595
brew install --HEAD usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller ios-deploy cocoapods
pod setup
所以還是推薦大家去看英文原版教程,更新比較及時(shí)。
三、最新的Android Studio Preview版本不支持flutter,建議使用正式版。