Flutter - I can't see any channel - flutter

I am trying to upgrade my flutter. When I hit flutter upgrade in the terminal in the android studio I receive the error 'Unable to upgrade Flutter: no origin repository configured. Run 'git remote add origin https://github.com/flutter/flutter''.
When I try to see flutter channels, I type flutter channel in the terminal in android studio, but I can't see any channels. The list is empty. Check the screenshot
After running the flutter channel stable in the terminal, it switched successfully. I ran the flutter upgrade command again and the same issue happened again. The screenshot is attached. New screenshot

Try flutter doctor, you will see flutter channel unknown. That is the reason, Flutter uses git to manage the Framework and when you checkout to different commit code / tags flutter channel changed to unknown.
Here is what you have to do:
flutter channel stable
Above I mentioned stable, if you need change the channel that you want to checkout (see available channels by flutter channel in terminal / cmd).
Then:
flutter upgrade
Everything should work now.
If not try below:
Go to flutter framework located directory and set upstream by git branch --set-upstream-to=origin/stable stable.
Please note that flutter channel stable is equivalent to git checkout stable if you try in flutter framework located directory.
Learn lot more info about this issue from already reported issue tracker.
Originally answered here.

try to run flutter stable channel and then flutter upgrade.
That should work.

Related

<< was unexpected at this time. flutter

i work on a flutter project but after uploading the file to github and trying to debug the code the terminal this response
<< was unexpected at this time.
i have fork repositorie of flutter maybe this cause the prob
i try to remove the flutter fork in my github but nothing happen
i check the FlutterGitUrl in the envirement variable but it was
https://github.com/flutter/flutter.git
i try flutter doctor but same line appear
the only command working is dart
You will need to delete the Flutter SDK folder then re-download again.
This happens when there are conflicts inside the Flutter SDK local repository (Flutter uses Git to manage itself).
I am not sure why it happens though. But since the SDK become unusable, it's far easier to just download a fresh SDK (same version) and delete the old one than searching for and solving conflicts throughout the SDK codebase.
Link to download a specific version of Flutter: https://docs.flutter.dev/development/tools/sdk/releases.

How to update specific flutter SDK channel?

Currently, i m using flutter 3.3.9 i want to update it to 3.7.3
Any particuler command?
Note : I don't want to affect my current code
Need perment solution for it.
Change channel if you are not in correct channel otherwise go to step 4
Open a terminal or command prompt on your computer.
Check the available Flutter channels by running the command flutter channel.
This will show you the list of available channels and the current channel you are on.
Switch to the desired channel by running the command flutter channel <channel-name>.
For example, to switch to the stable channel, you can run flutter channel stable.
Choose the version.
This is possible now with flutter version. In the console do flutter version to list the versions available. Then choose a version to switch to: flutter version v3.7.3
For these cases, try to use FVM (Flutter Version Management).
fvm install 3.7.3
fvm use 3.7.3
For get more detail here its official website https://fvm.app/
The advantages is you can any cases you can simply go back to your previous flutter version. And also you can work different flutter project with different version

How to move back to flutter stable

I am trying to develop a desktop application and I tried to switch to dev mode using this command flutter channel dev but since then all the flutter command I tried to run are not working. Below sis the error it's showing everytime I run any flutter command.
flutter/version: Operation not permitted
What can I do to solve this?
Easiest way would be to remove the current Flutter installation folder and extract a fresh one with the desired version. You do not have to change anything else, just extract the Flutter SDK in place of the old one and run flutter doctor.
in terminal write flutter channel stable
just run
flutter channel stable && flutter upgrade

flutter upgrade : The Flutter SDK is tracking a non-standard remote issue

Hello im trying to upgrade flutter sdk but im facing this issue when i type flutter upgrade
the pics are for the issue and the flutter doctor results
I think you should clone the original flutter repository (instead of a fork as you did) to be able to upgrade. So delete your current sdk and clone it from here

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

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.
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
or by using git
git checkout 1.24.0-10.2.pre(any version name)
flutter downgrade only works if you have a previous version of flutter installed from the same channel. It seems like you don't, so please use flutter version v1.17.4.
Find a list of flutter versions here: https://flutter.dev/docs/development/tools/sdk/releases
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