I have a project which was working fine but after updating Flutter I find a weird error when I run my app from the Android studio debug button
The current Flutter SDK version is 3.3.5.
Because doki_app depends on fluent_ui >=4.3.0 which requires Flutter SDK version
>=3.7.0, version solving failed.
but when I run it from the terminal every thing works fine.
[✓] Flutter (Channel stable, 3.7.10, on macOS 12.6 21G115 darwin-arm64, locale en-IR)
4
Answers
Go to
pubspec.lock
file in your project and search forsdks
term, then change both thedart
andflutter
versions due to your machine’sdart
andflutter
versions.An IDE or PC restart will make it better.
I guess that you have two different versions of Flutter namely
3.3.5
and3.7.10
installed on your computer. This is possible because your IDE has its own setting to know where it should look for Flutter SDK which is what is being used as described by yourcurrent SDK version
From the terminal when you are running the flutter command it uses your
PATH environment variable
to search for an executable matching your command name.So my guess is that your
IDE
andPATH environment variable
points to two different Flutter installations on your computer.Hence, to solve this you need to either update your
PATH environment variable
to point to the correct version. Ideally you will need to point it to the more latest3.7.10
if your planning on usingfluent_ui >= 4.3.0
run
then
then
then
if still not works run this command
It seems like you are have multiple flutter SDK versions installed on your computer.
In terminal you have default Flutter version 3.7.10.
In your Android Studio it seems like you have Flutter version 3.3.5, that’s why you get an error:
Make sure you have Flutter 3.7.10 selected on your Anroid Studio as well.