Question

flutter downgrade error - There is no previously recorded version for channel

My project uses packages that are not backward compatible,

I tired to install on a new PC but it install the latest flutter and I cannot downgrade flutter

$ flutter downgrade v1.22.6
Downloading Dart SDK from Flutter engine a252ec09b74cca0f8d8d3450566bf77c77f81e8d...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  199M  100  199M    0     0  1159k      0  0:02:55  0:02:55 --:--:-- 2695k
Building flutter tool...
Downloading Material fonts...                                    1,453ms
Downloading Gradle Wrapper...                                      242ms
Downloading package sky_engine...                                  914ms
Downloading flutter_patched_sdk tools...                            4.8s
Downloading flutter_patched_sdk_product tools...                    3.9s
Downloading linux-x64 tools...                                      7.3s
Downloading linux-x64/font-subset tools...                         874ms
There is no previously recorded version for channel "dev".

I tried on stable and beta as well

$ flutter downgrade v1.22.6
There is no previously recorded version for channel "stable".

flutter downgrade 1.22.6
There is no previously recorded version for channel "beta".

I also tried:

$ flutter version v1.22.6
WARNING: Flutter version command has been removed, using latest from channel
 46  53673  46
1 Jan 1970

Solution

 78

cd to flutter directory, e.g. /home/elia/snap/flutter/common/flutter

then do:

git checkout 1.22.6

2021-03-09

Solution

 8
  1. open flutter SDK directory on terminal, and type git checkout <sdk-version> e.g git checkout 2.5.0. just make sure the version you are asking for is correct as in the sdk documentation (https://docs.flutter.dev/development/tools/sdk/releases).
  2. Type flutter --version. if terminal dispaying something like Downloading Dart SDK from Flutter engine . . . means you just have to wait for the download update to finish.
  3. when download has finish, type again flutter --version to make sure that the sdk has changed.
  4. finish.
2022-01-05