How to Upgrade Flutter In Project IDX

334 Views Asked by At

I am facing issue with setting up my flutter app into project idx getting and git related error while upgrading the flutter versoion

flutter pub get --no-example
Resolving dependencies...
The current Dart SDK version is 3.1.2.

Because carconnect requires SDK version >=3.2.3 <4.0.0, version solving failed.

after running flutter upgrade i got following error

ProcessException: Process exited abnormally:
error: cannot open '.git/FETCH_HEAD': Read-only file system
  Command: git fetch --tags

i also tried deleting the .git file from the project but still getting the same

tried

flutter upgrade --force

but nothing changed

1

There are 1 best solutions below

1
Trees Tae On

I couldn't find to work the command flutter upgrade, but I can change flutter SDK version with nix setting.

  1. open '.idx/dev.nix' file.

  2. edit channel to "unstable"

    channel = "unstable";

  3. edit packages name from pkgs.flutter to pkgs.flutter316

    packages = [
        pkgs.flutter316
        pkgs.nodePackages.firebase-tools
        pkgs.jdk17
     ];
    
    
  4. Click right bottom button - Rebuild Environment

Now it's SDK 3.16.7 version. I don't know how to choose exact 3.16.3 SDK version.

There's few other versions such as flutter319, flutter313, etc.

You can check some other versions with this link.