flutter安装及项目踩坑

1.安装brew (Failed to connect to raw.githubusercontent.com port 443: Connection refused)

/bin/zsh -c “$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)”

管网历史版本
https://flutter.dev/docs/development/tools/sdk/releases?tab=macos#macos

将sdk拖到文档目录

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

flutter doctor

flutter vscode插件推荐

  1. Flutter 与 Dart

  2. 模版神器
    Awesome Flutter Snippets

3.对Dart语法有帮助的神器
Bracket Pair Colorizer

  1. 对项目开发有帮助的插件
    Material Icon Theme

配置 Flutter iOS环境

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
brew update
brew install --HEAD usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller ios-deploy cocoapods
pod setup

cd到目录下面
flutter pub get
cd ios目录下面
pod install

常见错误处理

1.warning: The iOS deployment target ‘IPHONEOS_DEPLOYMENT_TARGET’ is set to 4.3,
but the range of supported deployment target versions is 8.0 to 13.4.99.
config.build_settings[‘IPHONEOS_DEPLOYMENT_TARGET’] = ‘9.0’

2.flutter1.7.0版本对用的dio 库会出问题将dio 版本升到3.0.0以上(3.0.9)
dio.options.contentType = ContentType.parse(‘application/x-www-form-urlencoded’);
报错在后面加上.toString()

3.flutter1.5.0版本的fluro 里面会有个路由类名冲突

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值