Flutter upgrade error: Unknown flutter tag

31.6k Views Asked by At

~ flutter upgrade Unknown flutter tag. Abandoning upgrade to avoid destroying local changes. It is recommended to use git directly if not working on an official channel.

i try to upgrade my flutter sdk to latest version stable "flutter_macos_3.13.1-stable", but i have error message : "Unknown flutter tag. Abandoning upgrade to avoid destroying local changes. It is recommended to use git directly if not working on an official channel." Instead a successfully message .

11

There are 11 best solutions below

2
rdev On

Just run flutter upgrade --force

0
Priyanshu Sidar On

It also occurred in my case, I solved it using below command:

flutter upgrade -f

or

flutter upgrade --force

Both are same

4
Nirmal Code On

Run flutter upgrade from the flutter install directory. It works fine without the need to use --force or -f tags.

flutter upgrade -v for more verbose output.

0
bomi On

Use the force command or clone the flutter official repository. I think it is a temporary situation. Also after upgrading to 3.13 with the force command, we can update hotfix updates without using force. This is weird

1
Mark Salter On

I found that running a Flutter upgrade inside the install directory worked for me...

flutter doctor -v

gives the version, channel and install location:

flutter doctor -v

Output:

[✓] Flutter (Channel stable, 3.13.0, on Ubuntu 22.04.3 LTS 6.2.0-26-generic, locale en_GB.UTF-8)
    • **Flutter version 3.13.0 on channel stable at /home/mark/snap/flutter/common/flutter**
0
Bill Sanderson On

Check your working directory.

If you try and run the command "flutter upgrade", not from within the flutter install directory. I find you get this error. I was in my code directory and failed... I changed back to my main Flutter install directory and all "flutter upgrade" command worked fine.

error: Unknown flutter tag. Abandoning upgrade to avoid destroying local changes. It is recommended to use git directly if not working on an official channel.

0
tformatix On

I had the same problem when I tried to run the command in my project directory. The solution was to run the command flutter upgrade in the directory where the Flutter SDK is located (e.g. /path-to-flutter-sdk/bin/flutter).

0
Michael Wang On

I got this problem because somehow my flutter repository is outdated. So I have to git pull and then flutter upgrade works again:

$ cd ~/flutter
$ git status
On branch stable
Your branch is behind 'origin/stable' by 12 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)

$ git pull
...
$ flutter upgrade
(now it works)

Note: to find out where your flutter lives in, run flutter doctor -v and looking for 'Flutter version 3.13.6 on channel stable at'.

1
Karim Monir On

Save your changes of your current project, stash or commit and push to a git repo then just use:

flutter upgrade --force
0
mikyll98 On

You need to call flutter upgrade from Flutter install directory.


To find its location, you can use which command on Linux systems:

mikyll@debian-EQPNRAP:~$ which flutter
/home/mikyll/Programs/flutter/bin/flutter

And where on Windows (or which as well if you have it installed):

C:\Users\mikyll\Desktop>where flutter 
C:\Program Files\flutter\bin\flutter
C:\Program Files\flutter\bin\flutter.bat

Once you found it, you can change directory and finally call flutter upgrade:

$ cd /path/to/flutter/
$ flutter upgrade
0
Heshan Sandeepa On

One reason to get this error is trying to upgrade flutter sdk from another location other than the flutter sdk itself.

  1. Open the flutter sdk location from the terminal

    cd /<-- path -->/flutter 
    
  2. from inside, execute the upgrade command

    flutter upgrade