Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command doesn't works after upgrade flutter

Due to min v1.5 sdk plugin needs, I use flutter upgrade, but since I can't use command ... I have bash command not found,

I tried manually download 1.5 sdk and replace previous folder, when I use flutter doctor He say I have 1.2.1 ... I tried to re-upgrade but I have this error :

Your flutter checkout has local changes that would be erased by upgrading. If you want to keep these changes, it is
recommended that you stash them via "git stash" or else commit the changes to a local branch. If it is okay to remove
local changes, then re-run this command with --force.




C:\Users\utilisateur>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [version 10.0.17134.829], locale fr-FR)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.3)
[!] VS Code, 64-bit edition (version 1.21.1)
    X Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (1 available)

! Doctor found issues in 1 category.

I tried git clean -xfd

i have ...

C:\Users\utilisateur>git clean -xfd
Unlink of file '.AndroidStudio3.3/config/plugins/Dart/lib/Dart.jar' failed. Should I try again?
(y/n) Sorry, I did not understand your answer. Please type 'y' or 'n'
Unlink of file '.AndroidStudio3.3/config/plugins/Dart/lib/Dart.jar' failed. Should I try again? (y/ngit stash save --keep-index
) Sorry, I did not understand your answer. Please type 'y' or 'n'
Unlink of file '.AndroidStudio3.3/config/plugins/Dart/lib/Dart.jar' failed. Should I try againgit stash save --keep-index
? (y/n) Sorry, I did not understand your answer. Please type 'y' or 'n'
Unlink of file '.AndroidStudio3.3/config/plugins/Dart/lib/Dart.jar' failed. Should I try again? git stash save --keep-index
(y/n) Sorry, I did not understand your answer. Please type 'y' or 'n'
Unlink of file '.AndroidStudio3.3/config/plugins/Dart/lib/Dart.jar' failed. Should I try again? (y/n)
like image 360
Nitneuq Avatar asked Jun 20 '19 08:06

Nitneuq


Video Answer


1 Answers

In my case Flutter had unstaged changes (since it uses git), so I needed to stash or reset it to be able to upgrade it.

Go to flutter's path and:

# cd flutter_path/
git add -A
git reset --hard

Alternatively, you can use --force to upgrade it anyway.

flutter upgrade --force
like image 104
Mahdi-Malv Avatar answered Oct 10 '22 21:10

Mahdi-Malv