2

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
  • 554
  • 2
  • 4
  • 18

6 Answers6

8

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

Kaushik Chandru
  • 15,510
  • 2
  • 12
  • 30
1

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"
Keith DC
  • 661
  • 1
  • 9
  • 24
1

Try deleting pubspec.lock and try again

Hassan Hammad
  • 172
  • 1
  • 9
1

try

flutter upgrade

it worked for me.

1

just put your dependency without version

dependencies:
  flutter:
    sdk: flutter
  file_picker:        #put your conflicting dependency as without version
Noorus Khan
  • 1,342
  • 3
  • 15
  • 33
0

I solved the problem after updating Dart Sdk and restarting the pc. Even after these two steps I still got the same error, so I put any in the package value in pubspec.yaml and before running flutter pub get, I turned off my antivirus.

Kaya Ryuuna
  • 554
  • 2
  • 4
  • 18