最新消息:关注【已取消】微信公众号,可以获取全套资料,【全套Java基础27天】【JavaEE就业视频4个月】【Android就业视频4个月】

The current Flutter SDK version is 0.0.0-unknown错误完美解决

Flutter 太平洋学习网 浏览 评论

当我们用“Flutter run“命令运行我们的flutter项目时,会报出以下错误:

 xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

Resolving dependencies...

Note: leak_tracker_flutter_testing is pinned to version 3.0.3 by flutter_test from the flutter SDK.

See https://dart.dev/go/sdk-version-pinning for details.

The current Flutter SDK version is 0.0.0-unknown.

.Because every version of flutter_test from sdk depends on leak_tracker_flutter_testing >=2.0.3 which requires Flutter SDK version >=3.18.0-18.0.pre.54, flutter_test from sdk is forbidden.

So, because flutterdemomobile depends on flutter_test from sdk, version solving failed.

You can try the following suggestion to make the pubspec resolve:

* Try using the Flutter SDK version: 3.22.1. 


上面的错误显示我们的flutter test版本有问题,而且flutter的版本位unknown,这样就导致我们无法运行flutter项目了。


为什么会发生错误?


这是因为安装了Xcode软件的原因,它受到xcode的影响,所以你会得到一个错误,例如:当前的Flutter SDK版本是0.0.0-unknown,因为它无法在你的计算机中检测到Flutter SDK版本。


如何解决此问题呢?


我们可以运行下方这个命令:

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

如果还不行,报错的话,可以将上方命令替换为:

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

我们再使用运行“flutter doctor”命令时,flutter 的版本就会显示出来。100%有效解决!


来源网站:太平洋学习网,转载请注明出处:http://www.tpyyes.com/a/flutter/1219.html
"文章很值,打赏犒劳作者一下"
微信号: Javaweb_engineer

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

与本文相关的文章

发表我的评论
取消评论

表情

您的回复是我们的动力!

  • 昵称 (必填)

网友最新评论