关于Flutter doctor里两个警告的消除

作者 : admin 本文共740个字,预计阅读时间需要2分钟 发布时间: 2024-06-16 共1人阅读

在终端里输入 flutter doctor 是我们检查flutter是否配置好的方法。

在输出信息里常碰到两个警告

! Warning: `dart` on your path resolves to /usr/local/Cellar/dart/2.18.6/libexec/bin/dart,
      which is not inside your current Flutter SDK checkout at /Users/dengpeng/flutter. Consider
      adding /Users/xxxx/flutter/bin to the front of your path.

意思就是检测到了单独的 dart SDK

这里我用brew list 查看了自己安装列表
果然有,我们只要输入brew remove dart 删除此处的dart 即可消除这个Warning

还有一个

! CocoaPods 1.10.1 out of date (1.11.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins

说的是CocoaPods 版本已过时,让我们升级CocoaPods 版本

我们只要在终端输入

 gem install cocoapods

如果没权限输入

sudo gem install cocoapods

完成后就更新到最新版本

最后输入flutter doctor -v 查看Warning是否消失

本站无任何商业行为
个人在线分享 » 关于Flutter doctor里两个警告的消除
E-->