Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the flutter downgrade command to switch to an older version of Flutter SDK?

Tags:

flutter

I got the following error when trying to switch to an older version (1.17.4) from my current version (Flutter 1.20.1 • channel stable).

> flutter downgrade
There is no previously recorded version for channel "stable".
Channel "beta" was previously on: 1.17.0-dev.3.1

flutter downgrade is the recommended way for switching versions instead of the deprecated flutter version command. However, there's no documentation I may refer to how it is used.

like image 826
DYS Avatar asked Aug 16 '20 06:08

DYS


5 Answers

Another approach to downgrading is to change to the flutter-sdk directory and using git you can checkout a particular tag.

List the available tags with:

git tag

Then switch to a particular one with (e.g.):

git checkout 1.24.0-10.2.pre

(as I had to do today).

Note that this will switch which channel you are on and lock you at that version until you switch back with something like flutter channel dev once you believe the issue you faced is resolved.

like image 131
karora Avatar answered Oct 24 '22 10:10

karora


in my case , I switched flutter channel master then flutter downgrade v1.22.6 it work

like image 40
vinod yadav Avatar answered Oct 24 '22 10:10

vinod yadav


flutter downgrade only works if you have a previous version of flutter installed from the same channel. It seems like you don't, so please use flutter version v1.17.4.

Find a list of flutter versions here: https://flutter.dev/docs/development/tools/sdk/releases

like image 44
yellow cyber Avatar answered Oct 24 '22 09:10

yellow cyber


Check your flutter channel:

flutter channel

Show like this:

Flutter channels:
   master
   dev
   beta
 * stable

Change to master:

flutter channel master

Run command:

flutter downgrade v1.22.6
like image 22
Ania Avatar answered Oct 24 '22 08:10

Ania


if you want to keep both versions just download a zip of old version and put in the same folder where is a new version and change its name or you can change flutter path

like image 22
Johny Saini Avatar answered Oct 24 '22 08:10

Johny Saini