Because testing_app requires SDK version >=2.16.1 <3.0.0, version solving failed. in flutter

3,966

The answer is in the error message:

The current Dart SDK version is 2.15.1. Because testing_app requires SDK version >=2.16.1 <3.0.0, version solving failed.

It means that the project needs Dart SDK in version 2.16.1 (at least), and your version is 2.15.1.

You should upgrade your Flutter version with flutter upgrade. For more info see the documentation.

Share:
3,966
DavidIjsud
Author by

DavidIjsud

Updated on January 04, 2023

Comments

  • DavidIjsud
    DavidIjsud over 1 year

    I am learning more about testing and i want to use Mockito Package and Build Runner Packate then i have my class Cat inside lib/models/cat.dart

    My cat class

    then i have my lib/test/cat_test.dart file to test cat class

    cat_test.dart file

    this is my pubspec.yaml (part of it)

    Pubspec.yaml

    The problem is thrown when i want to run the next command :

    dart run build_runner build

    and the problem is the next:

    Resolving dependencies in /Users/adm/Documents/Things of david/PRACTICAS/Flutter/testing_app... The current Dart SDK version is 2.15.1. Because testing_app requires SDK version >=2.16.1 <3.0.0, version solving failed.

    Flutter doctor:

    Flutter doctor

    thank you so much for your help.

    • lava
      lava about 2 years
      environment: sdk: ">=2.14.0 <3.0.0" change in your pubsec.yaml
    • DavidIjsud
      DavidIjsud about 2 years
      The problem continue but with different error: Resolving dependencies in /Users/adm/Documents/Things of david/PRACTICAS/Flutter/testing_app... (1.7s) Because testing_app depends on integration_test from sdk which doesn't exist (the Flutter SDK is not available), version solving failed. Flutter users should run flutter pub get instead of dart pub get.