Reputation: 271
I updated my flutter version by flutter upgrade --force
command and now my project doesn't compile
is there is a way to downgrade to old version (i dont know my old version number)
please help me because this is my graduation project
Upvotes: 22
Views: 72724
Reputation: 1100
Assuming you used VS Code > terminal:
If you realized this before you clear the code in your terminal, just scroll back up and you will see the version you upgraded from to the current one as below:
Upgrading Flutter to 3.24.x from 3.10.x in D:\xxx\Flutter...
Then just run the following in the terminal:
flutter downgrade 3.10.x
Its pretty fast, but it will take some time to start downloading all the dependencies for that version again.
Upvotes: 1
Reputation: 1191
flutter downgrade versionnumber
and then
flutter doctor -v
works!
Upvotes: 0
Reputation: 443
This is the best method to switch flutter versions
Check the Flutter versions that you want and in what Channel from here https://docs.flutter.dev/development/tools/sdk/releases?tab=macos
on your terminal just type 1- switch to the channel that contains your version
flutter channel stable
2- downgrade using this
flutter downgrade v2.10.5
This is working for me every time
Upvotes: 4
Reputation: 53
What worked for me was downloading the version directly from Flutter SDK's website and replacing the old flutter folder from /Users/NAME/flutter/ with it.
Upvotes: 0
Reputation: 11
Simple question,
1- you have to access the directory where your flutter is installed by terminal.
ex: cd C:\src\flutter
2 - then, you write the command git checkout (number of version).
3 - flutter --version.
It's similar with the guy above, but the difference is that i was trying to install downloading the file on the link for sdk installations, but it didn't work. So, i followed these steps and it works for me.
Upvotes: 1
Reputation: 1354
flutter version
is now deprecated. flutter downgrade <version-no>
will do the trick ! After this run flutter doctor
. It will take care of the rest.
Upvotes: 1
Reputation: 1568
If you're seeing the message:
There is no previously recorded version for channel "stable".
Navigate to your Flutter installation folder and run git checkout flutter_version
If you're using snap on Linux and want to downgrade to 1.22.6:
cd $HOME/$USER/snap/flutter/common/flutter
git checkout 1.22.6
flutter --version
Upvotes: 32
Reputation: 1057
You need go to flutter sdk folder and run git command checkout your version
get flutter sdk path on android studio:
File -> Settings -> Languages & Frameworks -> Flutter -> FLutter SDK path
Change flutter channel if you want
flutter channel <branch> (example: flutter channel dev or flutter channel stable)
Change Flutter version:
git checkout <version> (example: git checkout 2.0.3)
after: flutter doctor -v
hope to help some body
Upvotes: 10
Reputation: 1618
Changing the Flutter version is like changing git branch.
if you want to change the channel use
flutter channel <branch> (example: flutter channel dev or flutter channel stable)
There are four flutter Channels
1). stable 2). dev 3). beta 4). master
You can further study about these channels from here
flutter downgrade <version>
You can see versions from here
After completion, run flutter doctor, and Flutter will take care of downloading/compiling everything required to run this version.
Upvotes: 2
Reputation: 753
For change the Flutter sdk version use this command: For upgrade the latest version:
flutter upgrade 1.20.0 //version number
For decrease the Flutter sdk version:
flutter downgrade 1.18.0 // version number
And for check the version which you Currently used:
flutter --version
Upvotes: 14