当前位置:网站首页>Flutter环境配置保姆级教程,让doctor一绿到底
Flutter环境配置保姆级教程,让doctor一绿到底
2022-07-02 06:38:00 【钧桐】
文章目录
写在前面
前端,是一个涉猎广泛的职业!不仅仅局限在web页面,我们还需要去写一些手机app,那么,我们就需要去学习Flutter
或者React-Native
等技术。
- 安装
Flutter
是件苦活,我在自己摸索的过程遇到了很多bug,过程是比较痛苦的- 比如安装好后,但是不能用,那这些会不会堆积下来影响电脑的性能?对追求完美的程序员来说,简直就是
精神折磨
- 比如安装好后,但是不能用,那这些会不会堆积下来影响电脑的性能?对追求完美的程序员来说,简直就是
- 下面就和大家泰勒说说如何配置Flutter环境
Download Flutter Sdk
- 进入Flutter官网进行下载
- 点击
Get started
进入到下一个页面- 右上角和主页下翻一点都可以找到这个按钮
- 点击
- 点击
macOS
后进行到下载页面System requirements
写了硬件的要求- 下面的
Get the Flutter SDK
就是我们要下载地方了
- 下面完成后,我们新建一个
development
文件夹然后解压到这个文件夹里面
Update Path Variable
- 然后运行下面的命令
cd ~/development
export PATH="$PATH:`pwd`/flutter/bin"
echo $SHELL
命令可以知道你现在在用哪个SHELL
- 创建
.zshrc
文件touch .zshrc
- 然后我们在文件夹下使用命令
command+shift+.
就可以看到隐藏文件了
- 打开
.zshrc
文件,进行编辑export PATH="$PATH:[PATH_OF_FLUTTER_GIT_DIRECTORY]/bin"
[PATH_OF_FLUTTER_GIT_DIRECTORY]
表示flutter/bin
的文件目录
- 所以,可能命令会是这样
export PATH="$PATH:/User/41/development/flutter/bin
- 注意:不要直接复制上面的命令啊,要用自己的目录去替换!!!
- 使用命令来运行
rc
文件- 网上是说
source $HOME/.zshrc
- 我是用
source $HOME/development/.zshrc
成功运行的
- 网上是说
- 之后使用
Flutter
,成功运行就说明SDK已经没问题了
- 运行
flutter doctor
来康康有啥问题,卧槽,大吃一惊
- 还有四个大错
cmdline-tools
Android license status unknown
Xcode
Android Studio
Install Xcode
- 在
App Store
搜索Xcode
直接进行下载安装就可以了- 就可以了吗?太天真了
- 下载完使用
flutter doctor
还是有Xcode
的报错
- 运行下面的命令来解决这个问题
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
- 现在
Xcode
的问题就正式解决了
Install Android Studio
- 先去android studio官网下载sdk
- 点击
下载Android Studio
- 点击
Download Android Studio
- 有个文档让你看,点已经读了,然后下载对应版本
- 芯片型号在关于本机中查看
- 点击
- 安装到应用中,这样才能解决doctor的问题
- 新版的
Android Studio
长这样- 我们在
More Action
中可以找到SDK Manager
- 在这个里面我们可以解决
cmdline-tools
的bug - 然后选择下面几个sdk然后apply进行下载,最后点ok就可以了
- 我们在
Accept Android Licenses
- 这个问题根据
flutter doctor
的提示运行下面的命令 flutter doctor --android-licenses
一绿到底
- 然后我们再次运行
flutter doctor
- bug,不存在的!
边栏推荐
猜你喜欢
[Fantasy 4] introduction and use of UMG components (under update...)
2021-10-02
This article takes you to learn in detail what is fiber to home FTTH
KS009基于SSH实现宠物管理系统
MPLS experiment
pytest学习--base
What is the relationship between realizing page watermarking and mutationobserver?
Feature (5): how to organize information
Leetcode -- the nearest common ancestor of 236 binary tree
Tee command usage example
随机推荐
Ue5 - AI pursuit (blueprint, behavior tree)
MPLS experiment
Webui automated learning
Spatial interpretation | comprehensive analysis of spatial structure of primary liver cancer
【Lua】常见知识点汇总(包含常见面试考点)
ERROR 1118 (42000): Row size too large (> 8126)
虚幻AI蓝图基础笔记(万字整理)
虛幻AI藍圖基礎筆記(萬字整理)
Blender camera surround motion, animation rendering, video synthesis
Leetcode -- the nearest common ancestor of 236 binary tree
Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
AutoCAD - layer Linetype
[unreal] animation notes of the scene
stm32和電機開發(上比特系統)
Considerations for Apache deploying static web page projects
pytest--之测试报告allure配置
[200 Shengxin literatures] 96 joint biomarkers of immune checkpoint inhibitor response in advanced solid tumors
Merge ordered sequence
2021-10-02
Delivery mode design of Spartacus UI of SAP e-commerce cloud