Unable to build flutter tools

964

Fixed.

I used git to switched branch to stable, then I run flutter upgrade, it worked fine, but I need to run a Linux app on flutter, so I used git to switch branch to dev, then run flutter upgrade again.

Share:
964
Adegoke Temitope
Author by

Adegoke Temitope

Updated on December 23, 2022

Comments

  • Adegoke Temitope
    Adegoke Temitope over 1 year

    Presently on the master channel, I switched to the beta channel then I run flutter upgrade to find out I can't use Linux as a device, so I switched back to the master branch, I run flutter upgrade. Then I started getting these errors:

    Because flutter_tools depends on collection >=1.15.0-nnbd <1.15.0-nullsafety.2
          which requires SDK version >=2.9.0-18.0 <=2.9.10, version solving failed.
    Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)
    

    The current Dart SDK version is 2.10.0-0.0.dev.flutter-a3815b6590.

    Flutter Info before switching to the master channel

    Flutter 1.18.0-11.1.pre • channel beta • https://github.com/flutter/flutter.git
    Framework • revision 2738a11 (3 months ago) • 2020-05-13 15:24:36 -0700
    Engine • revision ef9215ceb2
    Tools • Dart 2.9.0 (build 2.9.0-8.2.beta)
    

    I can't presently get any info on the master channel (which I am presently on) cause every time I run any flutter command, it tries to run pub upgrade with keeps giving error.

    I am assuming the issue is that Dart SDK upgraded, if I can roll back to a version compatible with the dependency it should work, or the dependency should be reviewed.

    • JideGuru
      JideGuru almost 4 years
      try this if the same thing happens flutter update-packages --force-upgrade
    • VLXU
      VLXU almost 4 years
      I think in your case, the Dart SDK needs to be upgraded. Yours is 2.9.0-8.2 while the min is >= 2.9.0-18.0
  • Łukasz Wiśniewski
    Łukasz Wiśniewski almost 4 years
    on dev I apparently had to git pull origin --ff-only and only then did flutter upgrade work