16

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

iKaka
  • 201
  • 1
  • 3
  • 8
  • i can upload it in github to see and help me – iKaka Mar 14 '21 at 01:15
  • Does this answer your question? [How to downgrade Flutter SDK (Dart 1.x)](https://stackoverflow.com/questions/49468321/how-to-downgrade-flutter-sdk-dart-1-x) – DDomen Mar 14 '21 at 02:09

9 Answers9

26

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
Eleandro Duzentos
  • 1,370
  • 18
  • 36
12

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

Amit Singh
  • 675
  • 6
  • 15
9

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

enter image description here

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

Hưng Trịnh
  • 947
  • 1
  • 12
  • 23
6
flutter downgrade versionnumber

Eg : flutter downgrade 1.25.0

3

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.

Arslan Kaleem
  • 1,410
  • 11
  • 25
2

This is the best method to switch flutter versions

First:

Check the Flutter versions that you want and in what Channel from here https://docs.flutter.dev/development/tools/sdk/releases?tab=macos

Second:

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

Ramy Wahid
  • 218
  • 2
  • 6
1

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.

Ali Yar Khan
  • 1,231
  • 2
  • 11
  • 33
  • So, this worked for me but sort of softly locked up. I couldn't stop the process or run anything, even after a half hour. I restarted Android Studio and ran `flutter doctor` and the process completed. – Regular Jo Jun 12 '22 at 16:16
0

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.

0

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.

ZeroCode
  • 53
  • 6