I tried to update flutter from this command using cmd:
flutter upgrade
And I got:
Unable to upgrade Flutter: no origin repository configured. Run 'git remote add origin https://github.com/flutter/flutter' in C:\flutter
What is the reason and how I can solve this?
I was trying to install flutter on my new ubuntu pc, following the directions on the official website: https://flutter.dev/docs/get-started/install/linux
I went with their initial steps of downloading the flutter sdk directly on my device, rather than cloning a git repo. Due to this my IDE kept popping a notification that the flutter version wasn't compatible.
I just had to delete the installed sdk files, and clone the git repo. This made it work like a charm.
Fixed it on Windows, I think this is a git issue:
PATH
contains latest Git (mine is2.25.1
, updated from1.18
) andflutter\bin
.git clone https://github.com/flutter/flutter.git
flutter channel master
flutter doctor --android-licenses
flutter doctor -v
flutter upgrade
I fixed this issue.I ran flutter channel stable,
I got the below output...
and then flutter upgrade --force before getting this
Try
flutter doctor
, you will seeflutter channel unknown
. That is the reason, Flutter uses git to manage the Framework and when youcheckout
to different commit code / tagsflutter channel
changed tounknown
.Here is what you have to do:
Above I mentioned
stable
, if you need change the channel that you want to checkout (see available channels byflutter channel
in terminal / cmd).Then:
Everything should work now.
If not try below:
Go to flutter framework located directory and set
upstream
bygit branch --set-upstream-to=origin/stable stable
.Please note that
flutter channel stable
is equivalent togit checkout stable
if you try in flutter framework located directory.Learn lot more info about this issue from already reported issue tracker.