Flutter环境搭建

本文介绍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"

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

 

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

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

p.p1 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff }
p.p2 { margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff; min-height: 13.0px }
span.s1 { }

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环境就搭建好了,希望能够帮助到您!附上成功的效果图





原文地址:https://www.cnblogs.com/ggband/p/9573952.html

时间: 2024-08-30 18:34:57

Flutter环境搭建的相关文章

Mac版最详细的Flutter开发环境搭建

上周任务不多,闲来无事想学习一下flutter耍一耍,发现flutter的环境搭建步骤还是很繁琐的,官网的搭建教程只是按步骤让你进行操作,中间出现的问题完全没有提及,对我这种没搞过原生开发的小白来说超级不友好.而网上很多相关博客教程,感觉不够详细,许多环境搭建过程中的坑确实是提到了,但解决的办法写的比较笼统,在此我将本次环境搭建锁遇到的各种奇奇怪怪的问题一一汇总,争取结合各路大神的博客加上自己实际遇到的问题整理出一篇超级实用且详细的教程,让童鞋们在学习flutter的路上少走弯路,让你的起跑顺畅

一、环境搭建

1 更新到最新版本的pip(这是安装python扩展包的一个插件)命令如下: python -m pip install --upgrade pip 2 使用pip安装virtualenv,命令 pip install virtualenv  如果要指定版本号,pip install virtualenv==15.0.1(安装虚拟环境) 3 创建django虚拟环境,命令 virtualenv django_basic_venv 4 使用虚拟环境 需要进入到安装目录的Scripts文件夹下,运行

Ionic2环境搭建及文件目录介绍

[注]引用自:http://blog.csdn.net/jasonzds/article/details/53821184 1环境搭建 一年前研究混合框架,初步确定了四种方案给公司选择,ionic,hbuilder,wex5,react-native这四个框架各有优缺点,ionic和react-native是国外框架,相对好一点,文档更新很快,就不一一说了,大概的思路都是一样的,js逻辑实现,同时调用原生功能,h5,css3 UI实现,其实他们都有自己的ui框架,当时选择了国内的hbuiler,

Selenium+Java+Eclipse 自动化测试环境搭建

一.下载Java windows java下载链接 https://www.java.com/zh_CN/download/win10.jsp 二.安装Java 安装好后检查一下需不需要配置环境变量,现在java 8已经不用配置环境变量了,直接在命令行输入:java -version 三.下载和安装Eclipse windows Eclipse下载链接 https://www.eclipse.org/downloads/ 你也可以下载绿色版 四.下载selenium,然后解压 selenium

Qt在Mac OS X下的编程环境搭建(配置Qt库和编译器,有图,很清楚)

尊重作者,支持原创,如需转载,请附上原地址:http://blog.csdn.net/libaineu2004/article/details/46234079 在Mac OS X下使用Qt开发,需要配置Qt库和编译器.编译器只能使用苹果公司自主研发的Clang.1.分别下载并安装XCode和Command Line Tools(必须安装),安装完毕后,Clang就有了. https://developer.apple.com/downloads/ 2.下载Qt并默认安装 http://down

基于 Eclipse 的 MapReduce 开发环境搭建

文 / vincentzh 原文连接:http://www.cnblogs.com/vincentzh/p/6055850.html 上周末本来要写这篇的,结果没想到上周末自己环境都没有搭起来,运行起来有问题的呢,拖到周一才将问题解决掉.刚好这周也将之前看的内容复习了下,边复习边码代码理解,印象倒是很深刻,对看过的东西理解也更深入了. 目录 1.概述 2.环境准备 3.插件配置 4.配置文件系统连接 5.测试连接 6.代码编写与执行 7.问题梳理 7.1 console 无日志输出问题 7.2

ICE分布式文件管理系统——ICE环境搭建(其二)

上一博文,我们讲述了ICE这个中间件的基本认识. 接下来我们讲述开发环境搭建. 其过程主要分为三步: 安装GCC-4.4.6.安装ICE-3.4.2.安装QT-4.7.3. (本文是基于LINUX下的ICE-3.4.2的安装,如果已安装了GCC(版本高于GCC-4.4.6亦可),请直接安装ICE) 一.安装GCC: (gcc各版本浏览地址:http://ftp.gnu.org/gnu/gcc/) 一般来说基于linux的操作系统都是默认安装了GCC的.假如说你的电脑没有的话 请百度一哈,可以解决

[Step-By-Step Angular2](1)Hello World与自动化环境搭建

随着rc(release candidate,候选版本)版本的推出,万众瞩目的angular2终于离正式发布不远啦!五月初举办的ng-conf大会已经过去了整整一个月,大多数api都如愿保持在了相对稳定的状态——当然也有router这样的例外,在rc阶段还在大面积返工,让人颇为不解——不过总得说来,现在学习angular2不失为一个恰当的时机. Google为angular2准备了完善的文档和教程,按理说,官网(https://angular.io)自然是学习新框架的最好教材.略显遗憾的是,在B

Linux交叉开发环境搭建 —— 效率之源

楼主今天终于把所有Linux开发环境需要的软件下载完毕了.虽然以前也是搭建过的,时间久了又折腾了一晚上. 交叉环境: Windows.Linux文件共享 SecureCRT 连接虚拟机终端 工具: VirtualBox ubuntu-16.04-desktop-amd64.iso(ubuntu官网下载) SecureCRT Source Insight 虚拟机搭建: 检查bios虚拟技术功能开启 新建虚拟机,选择创建虚拟硬盘,其余均默认 点击新建虚拟机设置->存储->选中没有光盘->点击