Flutter pub get version solving failed

10,414

Solution 1

Change version of webview_flutter in pubspec.yaml to webview_flutter: any

Solution 2

When you say you tried updating the Dart SDK, did you update your pubspec.yaml as well?

environment:
  sdk: ">=2.14.0 <3.0.0"

Solution 3

Try deleting pubspec.lock and try again

Share:
10,414
Kaya Ryuuna
Author by

Kaya Ryuuna

Updated on January 01, 2023

Comments

  • Kaya Ryuuna
    Kaya Ryuuna over 1 year

    I'm getting this issue with flutter pub get, tried to update the dart sdk, restart the pc to add the Dart sdk location back to the environment variables, delete the .git folder.

    Running "flutter pub get" in calculator...
    The current Dart SDK version is 2.13.4.

    Because calculator depends on webview_flutter >=2.0.14 which requires SDK version >=2.14.0 <3.0.0, version solving failed. pub get failed (1; Because calculator depends on webview_flutter >=2.0.14 which requires SDK version >=2.14.0 <3.0.0, version solving failed.) exit code 1

    Flutter doctor:

    Doctor summary (to see all details, run flutter doctor -v):
    [√] Flutter (Channel stable, 2.2.3, on Microsoft Windows [version 10.0.19043.1288], locale en-US)
    [√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    [√] Chrome - develop for the web
    [√] Android Studio (version 4.0)
    [√] VS Code (version 1.61.2)
    [√] Connected device (3 available)
    

    Dart Version:

    Dart SDK version: 2.14.4 (stable) (Wed Oct 13 11:11:32 2021 +0200) on "windows_x64"
    
  • Kaya Ryuuna
    Kaya Ryuuna over 2 years
    I already tried and got the same error.
  • Kaushik Chandru
    Kaushik Chandru over 2 years
    Delete pubspec.lock and try again please
  • Arijeet
    Arijeet over 2 years
    I have updated everything, still showing the same issue everytime.
  • Kaushik Chandru
    Kaushik Chandru over 2 years
    Please add any in pubspec for the plug-in that throws an error. Then delete pubspec.lock. Run flutter clean and flutter run