Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Your local changes to the following files would be overwritten by merge #819

Open
3 of 4 tasks
JCKodel opened this issue Feb 5, 2025 · 0 comments
Open
3 of 4 tasks
Labels
bug Something isn't working

Comments

@JCKodel
Copy link

JCKodel commented Feb 5, 2025

Before creating a bug report please make check the following

  • You have read our FAQ
  • If you have used flutter. Please install correctly, run pub cache repair. Close the terminal and try again.
  • If you are on Windows. Make sure you are running the terminal as administrator or with developer permissions.
  • Run fvm doctor if possible and add the output to the issue.

Describe the bug
Since at least Flutter 3.27.1, everytime I upgrade it through fvm, git gives me an error saying Your local changes... would be overwritten by merge.

This would be impossible, since everytime I use this command:

flutter pub cache clean && fvm remove 3.27.3 && fvm global 3.27.4 && flutter doctor

Basically, I clean the pub cache, remove the old stable version, install a brand new version (hence, merge conflicts should be impossible, right?), and then try to normalize the install with flutter doctor.

To Reproduce
In my setup, I have a pinned version for old projects and work most of the time with the latest "stable 🤡" Flutter.

Cache directory:  /Users/jckodel/fvm/versions
Directory Size: 4.98 GB

┌─────────┬─────────┬─────────────────┬──────────────┬──────────────┬────────┬───────┐
│ Version │ Channel │ Flutter Version │ Dart Version │ Release Date │ Global │ Local │
├─────────┼─────────┼─────────────────┼──────────────┼──────────────┼────────┼───────┤
│ 3.27.4  │ stable  │ 3.27.4          │ 3.6.2        │ Feb 5, 2025  │ ●      │       │
├─────────┼─────────┼─────────────────┼──────────────┼──────────────┼────────┼───────┤
│ 3.24.5  │ stable  │ 3.24.5          │ 3.5.4        │ Nov 14, 2024 │        │       │
└─────────┴─────────┴─────────────────┴──────────────┴──────────────┴────────┴───────┘

Expected behavior
Since it is a clean install of a previously-non-installed Flutter version, I would NOT expect merge conflicts.

Logs

In this case, I removed the 3.27.4 and reinstalled (because I had already removed the 3.27.3). Same error.

❯ flutter pub cache clean --verbose && fvm remove 3.27.4 --verbose && fvm global 3.27.4 --verbose && flutter doctor --verbose
[   +3 ms] executing: sw_vers -productName
[  +38 ms] Exit code 0 from: sw_vers -productName
[        ] macOS
[        ] executing: sw_vers -productVersion
[  +36 ms] Exit code 0 from: sw_vers -productVersion
[        ] 15.1
[        ] executing: sw_vers -buildVersion
[  +35 ms] Exit code 0 from: sw_vers -buildVersion
[        ] 24B83
[        ] executing: uname -m
[  +30 ms] Exit code 0 from: uname -m
[        ] x86_64
[  +31 ms] executing: sysctl hw.optional.arm64
[  +30 ms] Exit code 1 from: sysctl hw.optional.arm64
[        ] sysctl: unknown oid 'hw.optional.arm64'
[  +96 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +17 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'LegacyCanvasKitRemover' is not required, skipping update.
[        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[  +48 ms] executing: [/Users/jckodel/] /Users/jckodel/fvm/versions/3.27.4/bin/cache/dart-sdk/bin/dart pub --suppress-analytics cache clean --verbose
FINE: Pub 3.6.2
This will remove everything inside /Users/jckodel/.pub-cache.
You will have to run `flutter pub get` again in each project.
Are you sure? (y/N)? y
MSG : Removing pub cache directory /Users/jckodel/.pub-cache.
IO  : Deleting directory /Users/jckodel/.pub-cache.
IO  : Writing 370 characters to text file /Users/jckodel/.pub-cache/README.md.
FINE: Contents:
    | Pub Package Cache
    | =================
    |
    | This folder is used by Pub to store cached packages used in Dart / Flutter
    | projects.
    |
    | The contents of this folder should only be modified using the `dart pub` and
    | `flutter pub` commands.
    |
    | Modifying this folder manually can lead to inconsistent behavior.
    |
    | For details on how manage the `PUB_CACHE`, see:
    | https://dart.dev/go/pub-cache
IO  : Writing 1261 characters to text file /Users/jckodel/.pub-cache/log/pub_log.txt.
MSG : Logs written to /Users/jckodel/.pub-cache/log/pub_log.txt.
[+3589 ms] "flutter cache" took 3,659ms.
[ +273 ms] ensureAnalyticsSent: 251ms
[        ] Running 1 shutdown hook
[        ] Shutdown hooks complete
[   +3 ms] exiting with code 0

Argument information:
  Top level options:
  - verbose: true

Command: remove

Removing 3.27.4...
✓ 3.27.4 removed. (0ms)

Argument information:
  Top level options:
  - verbose: true

Command: global

Flutter SDK: SDK Version : 3.27.4 is not installed.
✔ Would you like to install it now? · yes
Syncing local mirror...
Standard out
Updating 1398dc7eec..0781d2efc8
Standard error
error: Your local changes to the following files would be overwritten by merge:
        engine/src/flutter/bin/et.bat
Please commit your changes or stash them before you merge.
Aborting
Installing Flutter SDK: SDK Version : 3.27.4
Cloning into '/Users/jckodel/fvm/versions/3.27.4'...
✓ Flutter SDK: SDK Version : 3.27.4 installed! (0ms)
Searching for project in /Users/jckodel
Searching for project in /Users
Searching for project in /
No project found in /Users/jckodel

Default in path: true
Cached version in path: false
Pinned version in path: false

flutterInPath: /Users/jckodel/fvm/default/bin
ctx.globalCacheBinPath: /Users/jckodel/fvm/default/bin
cacheVersion.binPath: /Users/jckodel/fvm/versions/3.27.4/bin
pinnedCacheVersion?.binPath: null

Flutter SDK: SDK Version : 3.27.4 is now global
Downloading Darwin x64 Dart SDK from Flutter engine 82bd5b7209295a5b7ff8cae0df96e7870171e3a5...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  213M  100  213M    0     0  24.8M      0  0:00:08  0:00:08 --:--:-- 28.5M
Building flutter tool...
Resolving dependencies...
Downloading packages... (2.5s)
Got dependencies.
Downloading Material fonts...                                      201ms
Downloading Gradle Wrapper...                                       13ms
Downloading package sky_engine...                                   56ms
Downloading package flutter_gpu...                                  12ms
Downloading flutter_patched_sdk tools...                            81ms
Downloading flutter_patched_sdk_product tools...                    92ms
Downloading darwin-x64 tools...                                  2,206ms
Downloading libimobiledevice...                                     15ms
Downloading usbmuxd...                                              10ms
Downloading libplist...                                             10ms
Downloading openssl...                                              48ms
Downloading ios-deploy...                                           13ms
Downloading darwin-x64/font-subset tools...                        321ms
[✓] Flutter (Channel stable, 3.27.4, on macOS 15.1 24B83 darwin-x64, locale en-BR)
    • Flutter version 3.27.4 on channel stable at /Users/jckodel/fvm/versions/3.27.4
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision d8a9f9a52e (5 days ago), 2025-01-31 16:07:18 -0500
    • Engine revision 82bd5b7209
    • Dart version 3.6.2
    • DevTools version 2.40.3

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/jckodel/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16C5032a
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)

[✓] VS Code (version 1.96.4)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.104.0

[✓] Connected device (5 available)
    • moto g 6 plus (mobile)              • 0048659732                           • android-arm64  • Android 9 (API 28)
    • Júlio’s iPhone (mobile)             • 00008030-00092DD92168C02E            • ios            • iOS 18.1.1 22B91
    • iPhone SE (3rd generation) (mobile) • 45842E71-D9F0-4938-BDCD-65FD975B282B • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-2 (simulator)
    • macOS (desktop)                     • macos                                • darwin-x64     • macOS 15.1 24B83 darwin-x64
    • Chrome (web)                        • chrome                               • web-javascript • Google Chrome 132.0.6834.160
    ! Error: Browsing on the local area network for iPad of XXXSTUPIDAPPLEXXX. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Desktop (please complete the following information):

  • OS: MacOS 15.1
  • FVM Version: 3.2.1

Additional context
Of course, I never touched anything in the Flutter folder:

On fvm\default folder:

❯ git status
On branch stable
Your branch is up to date with 'origin/stable'.

nothing to commit, working tree clean
@JCKodel JCKodel added the bug Something isn't working label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant