Flutter开发之——macOS上搭建Flutter开发环境

3.1 下载Flutter SDK

  • Stable channel (macOS)下载Flutter SDK

  • 将下载后的Flutter SDK移动到某个位置(如:资源库/flutter)

  • 添加flutter到path中(.bash_profile)

Flutter=/Users/zxc/Library/flutter

export PATH= F l u t t e r / b i n : Flutter/bin: Flutter/bin:PATH

  • 在terminal(终端)中输入 source .bash_profile (使用刚才更新之后的内容)

3.2 运行flutter doctor

  • 打开终端,输入下面的指令,检查是否需要安装其他依赖

flutter doctor

3.3 运行错误解决

3.3.1 Some Android licenses not accepted

在终端输入

flutter doctor --android-licenses

3.3.2 CocoaPods not installed

在终端输入

sudo gem install cocoapods

安装异常显示

ERROR: Could not find a valid gem ‘cocoapods’ (>= 0), here is why:

Unable to download data from https://rubygems.org/ - too many connection resets (https://rubygems.org/specs.4.8.gz)

删除旧的连接

gem sources --remove https://rubygems.org/

添加新的连接

gem sources -a https://gems.ruby-china.com

检查设置

gem sources -l

再次执行指令   再次执行flutter doctor指令

3.3.3 Flutter&Dart plugin not installed

打开android studio开发之工具,依次打开:android studio—>Preferences—>Plugins,输入Flutter安装

点击:Preferences—>Languages&Frameworks—>Dart&Flutter,配置Dart和Flutter路径

  • 7
    点赞
  • 30
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值