MapBox crashes on the latest Flutter version - flutter

MapBox map isn't working on the latest Flutter version (Flutter 3.3.2, Dart 2.18.1), but it works for my colleague but he is using v3.3.1. and Dart v2.18.0
How can I downgrade to that version?
When I do flutter downgrade v.3.3.1 in the terminal, it wants to downgrade to the previous version that was used, and for me, that was v2.8.1, and I can't seem to upgrade to a specific version, tried switching channels, but it didn't help.
And the problem is definitely in Flutter version.
Any ideas on how to upgrade(or downgrade) to a specific version?
Or maybe you have an idea why MapBox is crashing?

use FVM it will help to choose different flutter versions for different projects, so you can test different flutter versions

Related

Problem updating to a specific version of Flutter

I have an old version of flutter.
I would like to update the version but not to the latest. I tried the command
flutter upgrade
and then
flutter downgrade 3.3.1
but it only returns me to the version I had previously and not to an intermediate version between my old one and the latest version available.
What can I do?
Thank you.
To downgrade to a specific version of Flutter, you can use the following command:
flutter upgrade --force-downgrade -v enter your version here
Replace with the version number you want to downgrade to (e.g., 3.1.1). The --force-downgrade option is necessary as it allows you to downgrade to a previous version of Flutter.

How to downgrade flutter from version 2.5.3 to 1.22.6

I have some older projects built on flutter 1.22.6 and now I am working on latest version of flutter but there often comes need when I've to work on previous projects non null safety one's so when I try to downgrade flutter by giving command flutter downgrade 1.22.6 it tells me to downgrade to 2.5.2 and if I try to switch channel and then downgrade it downgrades to 2.5.2 first and then tells there is no version related to 1.22.6. This method used to be working before but now its not working anymore. I don't want to download zip files and then replace again flutter every-time I just want it to be done by cli.
My OS is windows 11
You can use flutter Version Manager fvm its specifically made to control flutter versions plus along with that you can install flutter sidekick as well. I am attaching link for you.
FVM Flutter Sidekick
Since you can no longer downgrade flutter versions, I have found the best way to do this is:
Download desired flutter version
Locate current 'flutter' folder and replace it with the desired version
if you run --flutter version after, it should show the correct version

VSCode, Flutter SDK Version Erroneous?

I believe my Flutter SDK version is being erroneously reported and do not know where the conflict is.
When running flutter doctor it reports Flutter 2.2.3 • channel stable. However, the bottom toolbar in VSCode displays Flutter: 2.0.4.
Is there a reason VSCode and terminal would report the Flutter version differently? And how can I ensure I am running the correct SDK version?
Look into "dart.flutterSdkPath" setting in vscode and change if needed. The problem could be with you having multiple versions of Flutter on the disk and auto-find fails to find the correct one (last version), manually override.
In my case my path( environment variables) of SDK was set wrong check yours first
and if still not worked try running commands
Flutter clean
Flutter upgrade

Flutter version used in project

Where can I see the flutter version used in a flutter project? Is there a file inside the project directory where I can see it? I think it is not specified inside the pubscpec.yaml file
So far, I think the specific version can not be found but only what versions can be used in a project. It can be found at the bottom part of pubscpec.lock file
pubspec.lock screenshot
It will not show version project wise. It will overall flutter version that you have installed in your system. For that:
Open your flutter project root directory in Command Prompt or Terminal type:
flutter --version command.
After typing the above command hit enter and You’ll see it will display us the currently installed flutter and Dart version in your computer and also tells us which version type we have installed like Stable or Beta.
Note: There is no such feature/command to check about which version of flutter you have used in Specific project.
Check this thread it will give you more idea:
https://github.com/flutter/flutter/issues/14230
All projects you run will use the flutter sdk installed in your machine/computer from where you specified its location from. So if the version the project uses don't match with the version you've and they conflict, you will have errors and if there is a huge gap and breaking changes, you'll need to either upgrade or downgrade the sdk. But most of the time, things are deprecated before they just become breaking changes and so you shouldn't have big issues. So the best thing to do is usually to upgrade. First check your sdk version via flutter --version. If its outdated, use flutter upgrade to upgrade it.
You can either run flutter --version to check flutter version installed on your machine or check it in your pubspec.lock file for current flutter version in your project
sdks:
dart: ">=2.10.0-110 <2.11.0"
flutter: ">=1.16.0 <2.0.0"

Dart version in Android and Flutter engine is different

My Flutter Engine using Dart version 2.5 whereas the dart in the android studio seems to have Dart 2.6.1.
Is that any potential issue while developing any project?
How can I ensure that both are same? How can I downgrade the version, please?
enter image description here
Don't worry about that. Flutter will keep using its own Dart version.
The other one will be used when running Dart scripts from CLI.