flutter安装记录过程

flutter doctor过程提示flutter version版本旧


flutter doctor

提示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语音一点了解都没有。

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 205,236评论 6 478
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 87,867评论 2 381
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 151,715评论 0 340
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 54,899评论 1 278
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 63,895评论 5 368
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 48,733评论 1 283
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,085评论 3 399
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 36,722评论 0 258
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 43,025评论 1 300
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 35,696评论 2 323
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 37,816评论 1 333
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 33,447评论 4 322
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,057评论 3 307
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,009评论 0 19
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,254评论 1 260
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 45,204评论 2 352
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 42,561评论 2 343

推荐阅读更多精彩内容