Flutter 起步问题汇总

https://book.flutterchina.club/chapter1/dart.html

https://flutterchina.club/widgets-intro/

https://www.cnblogs.com/zhangrunhao/p/9970656.html
https://www.jianshu.com/p/eb782589be82

0.当运行flutter doctor报错

0.问题:[!] Xcode - develop for iOS and macOS (Xcode 11.3.1)
✗ CocoaPods installed but not working.
You appear to have CocoaPods installed but it is not working.
This can happen if the version of Ruby that CocoaPods was installed with is different from the one being used to
invoke it.
This can usually be fixed by re-installing CocoaPods. For more info, see
https://github.com/flutter/flutter/issues/14293.
To re-install CocoaPods, run:
sudo gem install cocoapods
解答:当执行 sudo gem install cocoapods 无效是 或者提示没有权限的时候 执行

sudo gem install -n /usr/local/bin cocoapods

1.问题: ✗ Android license status unknown.
解答:打开“Android studio”,点“Configure”选择“SDK Manager ” -> android sdk -> sdk tools 然后把右下角的 hiden obsolete package 前边的对号点掉 然后上边的列表就多出了一个 Android sdk tools obsolete 然后点击前边的勾选 然后下载就行了 终端执行 flutter doctor --android-licenses 一直y下去

1.当运行flutter run是报错Exception: idevice_id returned an error: 可以执行下边命令

brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller

在这里插入图片描述

2.configure: error: Package requirements (libusbmuxd >= 1.1.0) were not met:

作为一个同时开发Android和iOS的人,我本地AndroidStudio和Xcode都安装了最新版。解压完zip包并且配置完环境变量之后运行flutter docker会提示安装brew install --HEAD libimobiledevice,直接运行这句命令会抛出以下异常:
configure: error: Package requirements (libusbmuxd >= 1.1.0) were not met:
Requested ‘libusbmuxd >= 1.1.0’ but version of libusbmuxd is 1.0.10
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables libusbmuxd_CFLAGS
and libusbmuxd_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
READ THIS: https://docs.brew.sh/Troubleshooting

这时候需要运行brew unlink usbmuxd & brew install --HEAD usbmuxd而不是libusbmuxd。
另外建议不用先按照flutter docker返回的提示安装,可

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值