4

~ 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 .

Cfcool100
  • 67
  • 6

6 Answers6

7

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.

NirmalCode
  • 2,140
  • 1
  • 14
  • 19
  • This worked. What may be the reason that it works from inside the install directory and not from any other directory? – Tarak Parab Sep 02 '23 at 05:32
4

Just run flutter upgrade --force

1

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

bomi
  • 113
  • 2
  • 11
0

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

flutter upgrade --f

or

flutter upgrade --force

Both are same

0

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**
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
-2

Sure, here's a step-by-step guide to help you resolve this issue:

  1. Check Flutter Channel:
  • Open a terminal and navigate to your Flutter project's root directory.
  • Run the command flutter channel to check which channel you're currently on.
  1. Change Flutter Channel:
  • If you're on the beta or dev channel, consider switching to the stable channel for a more reliable upgrade process.
  • To switch, use the command flutter channel stable.
  1. Update Flutter:
  • After switching the channel, wait for Flutter to download the stable version if needed.
  • Run flutter upgrade to upgrade Flutter to the latest stable version.
  1. Check for Changes:
  • After the upgrade, check if the error persists.
  • If the issue is resolved, you can proceed with your development.
  1. Further Assistance:
  • If the issue remains unresolved, you can seek further assistance on platforms like Stack Overflow or the Flutter community forums. Include the screenshot and details about your environment for better assistance.

For more detailed information on upgrading Flutter, you can refer to the official Flutter documentation: Flutter Upgrade Guide

Following these steps should help you overcome the "Unknown flutter tag" error and successfully upgrade your Flutter installation.

aravinth C
  • 95
  • 5
  • 3
    I am on stable, and I am getting the: "Unknown flutter tag. Abandoning upgrade to avoid destroying local changes. It is recommended to use git directly if not working on an official channel." – Worik Aug 30 '23 at 20:34
  • Do you have Android Studio? If yes, open your project with it and open the terminal, then run the "flutter update" command or open the pubspec.yaml file and upgrade from there. Otherwise, run "flutter update --force" in your terminal. As in the following answer. – Cfcool100 Aug 31 '23 at 14:04
  • 4
    This appears to be ChatGPT plagiarism. You were [previously warned](https://stackoverflow.com/a/76986692/4032703) that such answers are not permitted here. – EJoshuaS - Stand with Ukraine Sep 01 '23 at 14:39
  • Slip-up: *"you can seek further assistance on platforms like Stack Overflow or the Flutter community forums"* – Peter Mortensen Sep 02 '23 at 09:29