flutter 环境搭建
source link: https://sunjinshuai.github.io/2018/07/29/flutter-环境搭建/?amp%3Butm_medium=referral
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
一、获取Flutter SDK
要获得 Flutter
,请先使用 git
克隆 Flutter
,然后将该 flutter
工具添加到您的用户路径。运行 flutter doctor
显示您可能需要安装的剩余依赖项。
由于国内被墙,需要设置下载镜像:
export PUB_HOSTED_URL=https://pub.flutter-io.cn //国内用户需要设置 export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn //国内用户需要设置
Clone Flutter repo
git clone -b beta https://github.com/flutter/flutter.git
二、配置环境变量
vim ~/.bash_profile export PATH=`pwd`/flutter/bin:$PATH (或者) # export FLUTTER_HOME=/Users/sunjinshuai/flutter # export PATH=$PATH:$FLUTTER_HOME/bin: source ~/.bash_profile
三、运行 flutter doctor
查看是否需要安装其它依赖项来完成安装
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 ✗ 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.io/setup/#android-setup for detailed instructions). If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location. [✓] iOS toolchain - develop for iOS devices (Xcode 9.2) [✓] Android Studio (version 3.1) ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. [!] VS Code (version 1.25.1) [✓] Connected devices (2 available)
解决方法:
在 https://github.com/flutter/flutter/issues/13078
找到了解决方法,其实就是在 bash_profile
添加安卓SDK的环境变量即可。
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) ✗ Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses [✓] iOS toolchain - develop for iOS devices (Xcode 9.2) [✓] Android Studio (version 3.1) ✗ Flutter plugin not installed; this adds Flutter specific functionality. ✗ Dart plugin not installed; this adds Dart specific functionality. [!] VS Code (version 1.25.1) [✓] Connected devices (2 available) ! Doctor found issues in 2 categories.
Recommend
-
78
Flutter 是一款谷歌的用以同时在 iOS 和 Android 上制作高质量原生界面的移动应用UI框架.目前谷歌是已发布了 Flutter Beta 版,同时也提供了多个 Sample Project 供学习. Flutter 主要有着快速开发、有表现力及灵活的UI、原生表现等特点. 快速开发 极速热部署就能使...
-
36
-
43
下载Flutter Sdk 系统要求: 安装运行Flutter,开发环境必须满足以下要求: 操作系统:Windows 7 或者以上版本,64位机器 硬盘空间:不包括IDE和工具在内,至少需要400M 软件工具:...
-
35
原文作者:CoderSpr1ngHall 原文地址:
-
36
一直都想学一下flutter的,今天正式开始 安装 到官网上下载对应平台的sdk,然后安装好配置好环境变量 链接: https://flutter.dev/docs/get-started/install
-
71
安装Dart brew tap dart-lang/dart brew install dart # ~/.zshrc 或 ~/.bashrc 新增1行: export PATH="$HOME/.pub-cache/bin:$PATH" # pub 安装fvm (同时安装多个flutter版本) pub global activate fvm...
-
10
前言 这段时间一直都在学习和写关于SwiftUI的东西,前面也总结了四篇文章来大体上说了下Demo中功能实现的一些细节,后面准备开始了解学习一下Flutter,争取在年前能再用Flutter写一份项目Demo 出来,这个事在进行中,有需要的小...
-
8
Flutter教程01-搭建环境 从0开始学习跨平台开发APP赚钱。 MacBook Pro (13-inch, M1, 2020)
-
3
Ubuntu22搭建支持OpenHarmony的Flutter应用开发环境详细教程 原创 精华 实践过程中的部分视频演示 由于支持OpenHarmony的Flutt...
-
6
Ubuntu22搭建支持OpenHarmony的Flutter应用开发环境详细教程 作者:westinyang 2023-10-17 13:43:45 文中涉及到的一些源码存放目录和环境变量配置,请根据你实际存放的位置进行相应的调整。文章附件提供Flutter打...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK