本文介绍mac上搭建Flutter环境

1、Flutter官方提供中国地区镜像地址:https://github.com/flutter/flutter/wiki/Using-Flutter-in-China

2、下载Flutter源码 (官方建议下载beta分支)

git clone -b beta https://github.com/flutter/flutter.git

3、环境配置

  进入home目录 cd ~ , open -e .bash_profile(没有bash_profile文件,就创建一个touch .bash_profile

  export PUB_HOSTED_URL=https://pub.flutter-io.cn
  export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
  export PATH="/Users/MacBook/flutter/bin:$PATH"

  注:

    1、Run source $HOME/.bash_profile to refresh the current window.

    2、其中/Users/MacBook/flutter/bin就是刚刚下载的Flutter的bin目录

4、使用flutter doctor 命令进行安装

cd ./flutter
flutter doctor稍等片刻就会出现如下界面就会安装成功

Downloading Dart SDK from Flutter engine e3687f70c7ece72000b32ee1b3c02755ba5361ac...

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current

Dload  Upload   Total   Spent    Left  Speed

100 87.9M  100 87.9M    0     0  4247k      0  0:00:21  0:00:21 --:--:-- 4945k

Building flutter tool...

  ╔════════════════════════════════════════════════════════════════════════════╗

  ║                 Welcome to Flutter! - https://flutter.io                   ║

  ║                                                                            ║

  ║ The Flutter tool anonymously reports feature usage statistics and crash    ║

  ║ reports to Google in order to help Google contribute improvements to       ║

  ║ Flutter over time.                                                         ║

  ║                                                                            ║

  ║ Read about data we send with crash reports:                                ║

  ║ https://github.com/flutter/flutter/wiki/Flutter-CLI-crash-reporting        ║

  ║                                                                            ║

  ║ See Google's privacy policy:                                               ║

  ║ https://www.google.com/intl/en/policies/privacy/                           ║

  ║                                                                            ║

  ║ Use "flutter config --no-analytics" to disable analytics and crash         ║

  ║ reporting.                                                                 ║

  ╚════════════════════════════════════════════════════════════════════════════╝

  

Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!

Downloading Material fonts...                                0.6s

Downloading package sky_engine...                            0.3s

Downloading common tools...                                  0.8s

Downloading darwin-x64 tools...                              3.4s

Downloading android-arm-profile/darwin-x64 tools...          0.6s

Downloading android-arm-release/darwin-x64 tools...          0.7s

Downloading android-arm64-profile/darwin-x64 tools...        0.6s

Downloading android-arm64-release/darwin-x64 tools...        0.6s

Downloading android-x86 tools...                             1.9s

Downloading android-x64 tools...                             2.4s

Downloading android-arm tools...                             1.2s

Downloading android-arm-profile tools...                     0.9s

Downloading android-arm-release tools...                     0.7s

Downloading android-arm64 tools...                           1.1s

Downloading android-arm64-profile tools...                   1.0s

Downloading android-arm64-release tools...                   0.8s

Downloading ios tools...                                     4.3s

Downloading ios-profile tools...                             3.7s

Downloading ios-release tools...                             3.2s

Downloading Gradle Wrapper...                                0.1s

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

[✓] Flutter (Channel beta, v0.6.0, on Mac OS X 10.12.6 16G1510, locale zh-Hans-CN)

[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)

! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

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

    ✗ Brew not installed; use this to install tools for iOS device development.

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

[✓] Android Studio (version 3.0)

    ✗ Flutter plugin not installed; this adds Flutter specific functionality.

    ✗ Dart plugin not installed; this adds Dart specific functionality.

[!] Connected devices

! No devices available

! Doctor found issues in 3 categories.

5、安装androidsudio的Flutter插件

  

6、使用androidsudio建立Flutter项目

  

 

到此Futtler环境就搭建好了,希望能够帮助到您!附上成功的效果图





Flutter环境搭建的更多相关文章

  1. Flutter环境搭建以及快捷命令

    Flutter环境搭建 配置环境变量 用户变量 FLUTTER_STORAGE_BASE_URL : https://storage.flutter-io.cn PUB_HOSTED_URL : ht ...

  2. Mac最新Flutter环境搭建运行和对比理解声明式UI

    前言 这段时间一直都在学习和写关于SwiftUI的东西,前面也总结了四篇文章来大体上说了下Demo中功能实现的一些细节,后面准备开始了解学习一下Flutter,争取在年前能再用Flutter写一份项目 ...

  3. flutter环境搭建及跑起来demo(多图慎入)

    话不多说,直接上 [1]环境搭建 从git上面clone下来 git clone -b beta https://github.com/flutter/flutter.git 由于国内网络的问题,我就 ...

  4. Flutter环境搭建遇坑小结(一)

    对flutter的了解与开发也有一段时间了,总的来说,搭建开发环境遇到的各种坑也是很多,尤其对于初次接触Android开发的人员来说 一.flutter运行提示Running Gradle task ...

  5. win7系统下flutter环境搭建+AndroidStudio编译插件

    flutter学习网址:https://flutter-io.cn/ ----------------------------------------------------------------- ...

  6. Mac OS下Flutter环境搭建记录,VS Code开发

    安装Flutter 获取FlutterSDK 终端cd进入SDK安装目录,比如 cd ~/FlutterSDK 由于在国内访问Flutter有时可能会受到限制,Flutter官方为中国开发者搭建了临时 ...

  7. Flutter 入坑(1):flutter 环境搭建,window版本

    下载安装JAVA环境 1. 既然要做原生应用了,而且是基于Android的,那还是需要我们安装一下JAVA的环境的,我比一般得到一个新系统后首先做的就是这一步.    https://www.orac ...

  8. flutter 环境搭建

    环境: ladder什么的是必不可少的 win10 + Idea 2019.1.13 + Genymotion 2.12 基本可以在模拟器中运行项目,还有些许小问题,但是可以看到效果了 基本流程 下载 ...

  9. Flutter环境搭建遇坑小结(二)

    在上一节中,已经对Flutter运行中始终卡在Running Gradle task 'assembleDebug'...,做出了解决方案,继续往下运行,但是新的问题又出现了: Failed to i ...

随机推荐

  1. 关于修改banner信息;nginx反向代理apache应用

    本周实验 1. Linux下Apache部署一个php页面,返回http数据包中查看server信息,修改Apache 配置使server banner自定义. 2. nginx设置反向代理,代理上面 ...

  2. 【OO学习】OO第一单元作业总结

    OO第一单元作业总结 在第一单元作业中,我们只做了一件事情:求导,对多项式求导,对带三角函数的表达式求导,对有括号嵌套的表达式求导.作业难度依次递增,让我们熟悉面向对象编程方法,开始从面向过程向面向对 ...

  3. python 使用pip安装使用国内镜像加速下载安装包的方法

    清华大学提供开源镜像站:https://mirrors.tuna.tsinghua.edu.cn/help/pypi/ pypi 镜像每 5 分钟同步一次. pip install 包的名字 == 版 ...

  4. tnsping无法ping通的问题,TNS-12535 TNS操作超时 (服务器环境:window server 2008R2 数据库环境:oracle 11 g)

    今天新搭建一个测试用的数据库服务器,操作系统为WIN server 2008 r2 版本.系统内已安装oracle 11g database,数据库服务端已配置完毕,监听listener已开启. 我在 ...

  5. pip install torch on windows, and the 'from torch._C import * ImportError: DLL load failed:' solution

    通过pip安装PyTorch 0.4.0成功(cpu, not gpu; python3.5; pip): pip3 install http://download.pytorch.org/whl/c ...

  6. H5 实现图片上传预览

    <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...

  7. SP3871 GCDEX - GCD Extreme

    //author Eterna #define Hello the_cruel_world! #pragma GCC optimize(2) #include<iostream> #inc ...

  8. URL编码表 Base64编码表 HTTP消息含义

    URL编码表 backspace 8% A 41% a 61% § %A7 Õ %D5   tab 9% B 42% b 62% « %AB Ö %D6   linefeed %0A C 43% c ...

  9. sqlite 使用 cte 及 递归的实现示例

    1.多级 cte 查询示例. with cte as ( select pageid from cm_bookpage ) , cte2 as ( as content from cte ) sele ...

  10. mini-treeselect的动态赋值

    <div id="faultTree" allowdrag="false" allowdrop="true" class=" ...