W3Schools Learner's Blog

W3Schools Programming knowledge summary website



The current Flutter SDK version is 0.0.0-unknown --solved!

When you run Flutter project, you will get some errors, such as:

 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. 

Why the errors happened?

It's because of Xcode software, it is influenced by xcode, so you get an error such as: The current Flutter SDK version is 0.0.0-unknown, because it can't detected Flutter SDK version in your computer.

How to deal with the problems?

You can run the command in teminal: 

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

if some errors happened after you run above command, you can try the command below:

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

When you run "flutter doctor" command, the version of flutter will show after that.

100% workd!

No comments:

Post a Comment

Note: only a member of this blog may post a comment.