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

Viewed 18454

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.

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.

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

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

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

Related