fvm icon indicating copy to clipboard operation
fvm copied to clipboard

Version mismatch detected: cache version is 0.0.0-unknown

Open jibbers42 opened this issue 6 months ago • 6 comments

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 "Version mismatch detected" warning when trying to change versions using fvm use 3.19.1.

> fvm use 3.19.1

┌───────────────────────────────────────────────────────────────────────────────────┐
│ ⚠ Version mismatch detected: cache version is 0.0.0-unknown, but expected 3.19.1. │
└───────────────────────────────────────────────────────────────────────────────────┘
This can occur if you manually run "flutter upgrade" on a cached SDK.

? How would you like to resolve this? ›
❯ Move 0.0.0-unknown to the correct cache directory and reinstall 3.19.1
  Remove incorrect version and reinstall 3.19.1

I'm unsure what is happening and don't know which option to pick. What is 0.0.0-unknown and where is it being moved from?

I did not run flutter upgrade, but I did run fvm flutter pub upgrade --major-versions on another project.

I decided to choose Move ... and it created a 0.0.0-unknown in my fvm cache versions folder. Not sure what this is.

FVM seems to be working again. Next time I'll choose Remove ... and see what happens.

To Reproduce Unsure, but after installing v3 this seems to happen after changing Flutter versions in one project and then switching to another project to update it.

Expected behavior A clear and concise description of what you expected to happen.

Logs Please provide the verbose logs by running --verbose after the command.

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows 11
  • FVM Version [e.g. 22] 3.0.7
  • If Windows: Which Powershell are you using? PowerShell 7.4.1

Additional context Add any other context about the problem here.

jibbers42 avatar Feb 22 '24 02:02 jibbers42

@jibbers42 I did a basic test and was not able to replicate it.

This issue is known within the Flutter tool side, which can happen for different reasons when it does not find a reference to the channel/branch. I have not seen this issue in a while. But can you let me know if you stumble upon it again?

leoafarias avatar Feb 22 '24 15:02 leoafarias

It happened a couple times, but may not happen again until a new Flutter release comes out, if then. I'll try to get in touch before "fixing" it so maybe we can determine the issue.

jibbers42 avatar Feb 22 '24 19:02 jibbers42

I had this happen again. Here is a note of the recent things I did:

  • flutter upgrade in non project dir to upgrade global flutter to 3.19.3
  • create a new flutter project for testing
  • cd to existing project to a git submodule (something like project/submodules/subproject/)
  • fvm use 3.19.3, run tests, commit
  • cd up two levels to get to main project (project/)
  • fvm use 3.19.3
> fvm use 3.19.3
┌───────────────────────────────────────────────────────────────────────────────────┐
│ ⚠ Version mismatch detected: cache version is 0.0.0-unknown, but expected 3.19.3. │
└───────────────────────────────────────────────────────────────────────────────────┘
This can occur if you manually run "flutter upgrade" on a cached SDK.

? How would you like to resolve this? ›
❯ Move 0.0.0-unknown to the correct cache directory and reinstall 3.19.3
  Remove incorrect version and reinstall 3.19.3

I chose Remove... and it starting working after that process. After this I switched to 3.19.1 (already installed) first in submodule then switched in main module, but it did not repro. Next I swtiched to 3.19.2 (not installed so I said yes to install) first in submodule then switched in main module , but it did not repro.

Not sure if it had something to do with upgrading the global flutter, but that wouldn't be a "cached SDK".

I didn't think to fvm doctor before fixing it to see if it said anything useful. I'll try to remember next time.

jibbers42 avatar Mar 16 '24 03:03 jibbers42

@jibbers42 I might need a bit more info, base don what you described you never ran flutter upgrade on the cache version?? Does the global version point to an FVM cache if so which one?

leoafarias avatar Mar 16 '24 14:03 leoafarias

@jibbers42 also I found this on stack overflow it might be worth taking a look

https://stackoverflow.com/a/74220889

leoafarias avatar Mar 16 '24 14:03 leoafarias

I might need a bit more info, base don what you described you never ran flutter upgrade on the cache version?? Does the global version point to an FVM cache if so which one?

No, it's installed separately from FVM:

> where.exe flutter
C:\Users\jibbe\.local\bin\flutter\bin\flutter
C:\Users\jibbe\.local\bin\flutter\bin\flutter.bat

My FVM cache is at D:\cache\fvm

also I found this on stack overflow it might be worth taking a look https://stackoverflow.com/a/74220889

I don't think this applies as I'm currently on Windows.

I'll update if I get more info.

jibbers42 avatar Mar 16 '24 15:03 jibbers42