flutter doctor过程提示flutter version版本旧
提示5个错误
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.12.2 16C67, locale zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.1)
✗ Android SDK file not found: /Users/conan/Library/Android/sdk/platforms/android-28/android.jar.
[!] iOS toolchain - develop for iOS devices
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
✗ libimobiledevice and ideviceinstaller are not installed. 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
[✓] Android Studio (version 3.1)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Community Edition (version 2016.3.4)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
✗ This install is older than the minimum recommended version of 2017.1.0.
[!] IntelliJ IDEA Ultimate Edition (version 2016.3.4)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
✗ This install is older than the minimum recommended version of 2017.1.0.
[!] Connected devices
! No devices available
! Doctor found issues in 5 categories.
➜ flutter git:(beta) flutter doctor
zsh: command not found: flutter
➜ flutter git:(beta) cd ..
➜ ~ flutter doctor
zsh: command not found: flutter
解决安装libimobiledevice and ideviceinstaller
✗ libimobiledevice and ideviceinstaller are not installed. To install, run:
brew install --HEAD libimobiledevice
brew install ideviceinstaller
提示 /usr/local/Frameworks 路径没有权限
解决如下 sudo mkdir /usr/local/Frameworks
==> Installing libimobiledevice dependency: python@2
==> Downloading https://homebrew.bintray.com/bottles/python@2-2.7.15_1.high_sier
######################################################################## 100.0%
==> Pouring python@2-2.7.15_1.high_sierra.bottle.1.tar.gz
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ dir_s_mkdir - /usr/local/Frameworks
Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks
➜ ~ sudo mkdir /usr/local/Frameworks
Password:
安装过程日志
~ brew install --HEAD libimobiledevice
==> Installing dependencies for libimobiledevice: libxml2, pkg-config, libtasn1, libplist, libusb, usbmuxd
==> Installing libimobiledevice dependency: libxml2
==> Downloading https://homebrew.bintray.com/bottles/libxml2-2.9.7.high_sierra.b
######################################################################## 100.0%
==> Pouring libxml2-2.9.7.high_sierra.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/libxml2/bin:$PATH"' >> ~/.zshrc
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/libxml2/lib
CPPFLAGS: -I/usr/local/opt/libxml2/include
==> Summary
🍺 /usr/local/Cellar/libxml2/2.9.7: 281 files, 10.4MB
==> Installing libimobiledevice dependency: pkg-config
==> Downloading https://homebrew.bintray.com/bottles/pkg-config-0.29.2.high_sier
######################################################################## 100.0%
==> Pouring pkg-config-0.29.2.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/pkg-config/0.29.2: 11 files, 627.2KB
==> Installing libimobiledevice dependency: libtasn1
==> Downloading https://homebrew.bintray.com/bottles/libtasn1-4.13.high_sierra.b
######################################################################## 100.0%
==> Pouring libtasn1-4.13.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/libtasn1/4.13: 59 files, 435KB
==> Installing libimobiledevice dependency: libplist
==> Downloading https://homebrew.bintray.com/bottles/libplist-2.0.0.high_sierra.
######################################################################## 100.0%
==> Pouring libplist-2.0.0.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/libplist/2.0.0: 31 files, 768.6KB
==> Installing libimobiledevice dependency: libusb
==> Downloading https://homebrew.bintray.com/bottles/libusb-1.0.22.high_sierra.b
######################################################################## 100.0%
==> Pouring libusb-1.0.22.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/libusb/1.0.22: 29 files, 514.8KB
==> Installing libimobiledevice dependency: usbmuxd
==> Downloading https://homebrew.bintray.com/bottles/usbmuxd-1.0.10_1.high_sierr
######################################################################## 100.0%
==> Pouring usbmuxd-1.0.10_1.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/usbmuxd/1.0.10_1: 13 files, 120KB
==> Installing libimobiledevice --HEAD
==> Cloning https://git.libimobiledevice.org/libimobiledevice.git
Cloning into '/Users/conan/Library/Caches/Homebrew/libimobiledevice--git'...
remote: Counting objects: 8152, done.
remote: Compressing objects: 100% (5441/5441), done.
remote: Total 8152 (delta 6094), reused 3619 (delta 2654)
Receiving objects: 100% (8152/8152), 1.53 MiB | 92.00 KiB/s, done.
Resolving deltas: 100% (6094/6094), done.
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
==> ./autogen.sh
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/libimobiledevi
==> make install
🍺 /usr/local/Cellar/libimobiledevice/HEAD-26373b3_2: 67 files, 1013.8KB, built in 1 minute 12 seconds
==> Caveats
==> libxml2
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.
If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/libxml2/bin:$PATH"' >> ~/.zshrc
For compilers to find this software you may need to set:
LDFLAGS: -L/usr/local/opt/libxml2/lib
CPPFLAGS: -I/usr/local/opt/libxml2/include
For pkg-config to find this software you may need to set:
PKG_CONFIG_PATH: /usr/local/opt/libxml2/lib/pkgconfig
安装 ideviceinstaller
~ brew install ideviceinstaller
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> Updated Formulae
php-code-sniffer tomcat@8
==> Installing dependencies for ideviceinstaller: libzip
==> Installing ideviceinstaller dependency: libzip
==> Downloading https://homebrew.bintray.com/bottles/libzip-1.5.1.high_sierra.bo
######################################################################## 100.0%
==> Pouring libzip-1.5.1.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/libzip/1.5.1: 134 files, 577KB
==> Installing ideviceinstaller
==> Downloading https://homebrew.bintray.com/bottles/ideviceinstaller-1.1.0_4.hi
######################################################################## 100.0%
==> Pouring ideviceinstaller-1.1.0_4.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/ideviceinstaller/1.1.0_4: 8 files, 64.5KB
安装 ios-deploy
~ brew install ios-deploy
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/ios-deploy-1.9.2.high_sierr
######################################################################## 100.0%
==> Pouring ios-deploy-1.9.2.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/ios-deploy/1.9.2: 7 files, 153.8KB
To install:
brew install cocoapods
pod setup
➜ ~ brew install ios-deploy
Updating Homebrew...
==> Downloading https://homebrew.bintray.com/bottles/ios-deploy-1.9.2.high_sierr
######################################################################## 100.0%
==> Pouring ios-deploy-1.9.2.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/ios-deploy/1.9.2: 7 files, 153.8KB
➜ ~ brew install cocoapods
==> Downloading https://homebrew.bintray.com/bottles/cocoapods-1.5.3.high_sierra
######################################################################## 100.0%
==> Pouring cocoapods-1.5.3.high_sierra.bottle.tar.gz
🍺 /usr/local/Cellar/cocoapods/1.5.3: 8,923 files, 13.2MB
➜ ~ pod setup
Setting up CocoaPods master repo
$ /usr/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
Cloning into 'master'...
remote: Counting objects: 2314481, done.
remote: Compressing objects: 100% (467/467), done.
remote: Total 2314481 (delta 227), reused 254 (delta 99), pack-reused 2313894
Receiving objects: 100% (2314481/2314481), 557.37 MiB | 2.65 MiB/s, done.
Resolving deltas: 100% (1333677/1333677), done.
Setup completed
解决
[!] iOS toolchain - develop for iOS devices
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
➜ ~ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
Password:
xcode-select: error: invalid developer directory '/Applications/Xcode.app/Contents/Developer'
//出现如上错误是因为我安装Xcode之后没有把应用添加到应用程序目录下面:
//这里把Xcode添加进去,在执行命令就好了。
➜ ~ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
Password:
➜ ~
iOS 安装pod
➜ ios git:(beta) ✗ pod install
Generated.xcconfig must exist. If you're running pod install manually, make sure flutter build or flutter run is executed once first.
Analyzing dependencies
Downloading dependencies
Generating Pods project
Integrating client project
Pod installation complete! There are 0 dependencies from the Podfile and 0 total pods installed.
[!] The Podfile does not contain any dependencies.
[!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
➜ ios git:(beta) ✗
android 解决错误
[!] Android toolchain - develop for Android devices (Android SDK 28.0.1)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
再诊断一次 ,现在ANDROID的环境除了两个插件之外都已经配置好了。
这里注意下要配置下flutter的路径,不然不能在任何路径下使用flutter。
翻墙安装好Flutter的插件。iOS和ANDROID环境就已经OK了。
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
➜ ~ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.5.1, on Mac OS X 10.13.6 17G65, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.4.1)
[✓] Android Studio (version 3.1)
[!] IntelliJ IDEA Ultimate Edition (version 2016.3.4)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
✗ This install is older than the minimum recommended version of 2017.1.0.
[!] IntelliJ IDEA Community Edition (version 2016.3.4)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
✗ This install is older than the minimum recommended version of 2017.1.0.
[✓] Connected devices (1 available)
! Doctor found issues in 2 categories.
修改配置文件
export PUB_HOSTED_URL=https://pub.flutter-io.cn //国内用户需要设置
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn //国内用户需要设置
export PATH=`FLUTTER_ROOT`/flutter/bin:$PATH //这里是我的路径配置 没给全部
主要是最上面两个配置不然应用可能跑不了。
如果出现flutter command locked ,说明其他地方可能在执行flutter命令,得停止掉, 一开始项目运行不了,可能需要执行flutter upgrade 命令。
到这里我已经在mac运行起来了项目。但是对Dart语音一点了解都没有。