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
Related
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.
I want to migrate my flutter project to my new pc, the android studio and flutter are all set in the new pc. If I make a new flutter project, it works fine, however, if I open the project from my old PC, It cannot detect the flutter library. Any suggestions?
Flutter doctor result
Use this command
flutter clean
flutter pub get
flutter packages get
flutter packages upgrade ( Optional - use if you want to upgrade packages )
Restart Android Studio or VS Code
Hopefully the problem will be solved.
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
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.
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