Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter upgrade fail

Tags:

flutter

When I attempt to update Flutter I get the following error.

error: Your local changes to the following files would be overwritten by merge: examples/flutter_gallery/ios/Runner.xcodeproj/project.pbxproj

Please commit your changes or stash them before you merge.

Aborting Updating f9bb4289e..5ab9e7072 Process finished with exit code 1

I suspect at some point I did something in the examples project and I don't care about loosing the changes.

What is the easiest thing to do?

like image 785
dakamojo Avatar asked Sep 19 '18 03:09

dakamojo


People also ask

How do I upgrade my flutter upgrade?

You can update in android studio using Tools so follow these steps Android Studio -> Tools -> Flutter -> Flutter Upgrade. Show activity on this post. Show activity on this post. Just run the flutter upgrade in terminal.

How do you upgrade the flutter in VS code?

By default, VS Code automatically updates extensions when updates are available. To install updates manually: Click the Extensions button in the Side Bar. If the Flutter extension is shown with an available update, click the update button and then the reload button.


5 Answers

Go to your flutter home directory and do git checkout . or git reset head --hard

like image 101
Dinesh Balasubramanian Avatar answered Oct 20 '22 05:10

Dinesh Balasubramanian


In the Flutter install directory please run

git clean -xfd
git stash save --keep-index
git stash drop
git pull
flutter doctor
like image 24
Günter Zöchbauer Avatar answered Oct 20 '22 04:10

Günter Zöchbauer


I had the same problem and git reset --hard origin/beta in the flutter home directory fixed it. In my case git status revealed that "You have unmerged paths."

Note that for the stable branch you need this:

cd $FLUTTER_HOME    
git reset --hard origin/stable
like image 29
StefanTo Avatar answered Oct 20 '22 04:10

StefanTo


Below worked with me to get 1.0.0-stable:

$ git clean -xfd
$ git checkout origin/stable
$ git pull
$ flutter doctor
$ flutter --version
Flutter 1.0.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5391447fae (5 days ago) • 2018-11-29 19:41:26 -0800
Engine • revision 7375a0f414
Tools • Dart 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
like image 43
Hasan A Yousef Avatar answered Oct 20 '22 04:10

Hasan A Yousef


This happened to me too! What i did that worked was to rename flutter.gradle to anything e.g flutttttterrrr.gradle then run flutter upgrade command again.

The file is located at C:\your_flutter_location\flutter_main_folder\packages\flutter_tools\gradle

Hope this helps someone.

like image 26
The Billionaire Guy Avatar answered Oct 20 '22 04:10

The Billionaire Guy