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?
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.
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.
Go to your flutter home directory and do git checkout .
or git reset head --hard
In the Flutter install directory please run
git clean -xfd
git stash save --keep-index
git stash drop
git pull
flutter doctor
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
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)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With