Flutter安装的一些注意事项

指令 :flutter doctor 提示未安装的按照提示安装,如果没有brew先安装brew.

Doctor summary(to see all details,run flutter doctor -v):

[✓]Flutter(Channel stable,v1.5.4-hotfix.2,on Mac OS X 10.14.5 18F132,locale

    zh-Hans-CN)

[✗]Android toolchain - develop for Android devices

    ✗ Unable to locate Android SDK.

      Install Android Studio from:

      https://developer.android.com/studio/index.html

      On first launch it will assist you in installing the Android SDK

      components.

      (or visit https://flutter.dev/setup/#android-setup for detailed

      instructions).

      If the Android SDK has been installed to a custom location, set

      ANDROID_HOME to that location.

      You may also want to add it to your PATH environment variable.

[!]iOS toolchain - develop for iOS devices(Xcode 10.2.1)

    ✗ libimobiledevice and ideviceinstaller are not installed. To install with

      Brew, run:

        brew update

        brew install --HEAD usbmuxd

        brew link usbmuxd

        brew install --HEAD libimobiledevice

        brew install ideviceinstaller

    ✗ ios-deploy not installed. To install:

        brew install ios-deploy

    ✗ Brew can be used to install tools for iOS device development.

      Download brew at https://brew.sh/.

[!]Android Studio(not installed)

[!]Connected device

    ! No devices available

更新环境变量的时候 

在修改完.bash_profile之后要让.bash_profile生效的命令是:source .bash_profile;

不然会出现:flutter: command not found

.bash_profile修改内容为:

exportPUB_HOSTED_URL=https://pub.flutter-io.cn //国内用户需要设置exportFLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn //国内用户需要设置exportPATH=PATH_TO_FLUTTER_GIT_DIRECTORY/flutter/bin:$PATH

注意路径也要正确,PATH_TO_FLUTTER_GIT_DIRECTORY要替换成你自己解压以后的flutter文件目录所在的路径,例如:export PATH=/Users/lixiwei/Desktop/flutter/flutter/bin:$PATH

-----------------------------------------------------------

新问题

bogon:flutter lixiwei$ flutter doctor

Doctor summary (to see all details, run flutter doctor -v):

[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.5 18F132, locale

    zh-Hans-CN)

[✗] Android toolchain - develop for Android devices

    Unable to locate Android SDK.

      Install Android Studio from:

      https://developer.android.com/studio/index.html

      On first launch it will assist you in installing the Android SDK

      components.

      (or visit https://flutter.dev/setup/#android-setup for detailed

      instructions).

      If the Android SDK has been installed to a custom location, set

      ANDROID_HOME to that location.

      You may also want to add it to your PATH environment variable.

[!] 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

[!] Android Studio (not installed)

[✓] Connected device (1 available)


我的xcode是app store直接安装的,但是不知道为啥会提示这个,我确认不需要再去下载或者app store重装,所以直接执行sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer ,问题解决

你可能感兴趣的:(Flutter安装的一些注意事项)