0

hello I tried running flutter pub get and I was faced with this error:

 flutter pub get
    Waiting for another flutter command to release the startup lock...
    Running "flutter pub get" in Deutsche-Flutter...                
    Because every version of flutter_test from sdk depends on test_api 0.3.0 and mockito 4.1.4 depends on test_api ^0.2.19-nullsafety, flutter_test from sdk is incompatible with mockito 4.1.4.
    And because no versions of mockito match >4.1.4 <5.0.0, flutter_test from sdk is incompatible with mockito ^4.1.4.
    So, because deutsche depends on both mockito ^4.1.4 and flutter_test any from sdk, version solving failed.
    pub get failed (1; So, because deutsche depends on both mockito ^4.1.4 and flutter_test any from sdk, version solving failed.)
    exit code 1

I already ran flutter upgrade and tried to run flutter pub get here are my dependencies:

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.0
  flutter_svg: ^0.19.1
  flutter_bloc: ^6.1.2
  get: ^3.23.1
  rxdart: ^0.19.0
  http: ^0.12.2
  google_fonts: ^0.3.9
  circular_countdown_timer: ^0.1.0
  pin_code_fields: ^2.4.0
  google_nav_bar: ^3.2.0
  line_icons: ^0.2.0
  shared_preferences: ^0.5.12+4
  flutter_launcher_icons: ^0.7.2+1   
  rive: ^0.6.8
  timer_count_down: ^1.0.4+1
  logger: ^0.9.4
  dartz: ^0.9.0-dev.6
  freezed_annotation: ^0.12.0
  bloc_test: ^7.1.0
  mockito: ^4.1.4
  jwt_decode: ^0.3.1
  carousel_slider: ^3.0.0


dev_dependencies:
  build_runner:
  freezed: ^0.12.7
  flutter_test:
    sdk: flutter

3 Answers 3

1

Update all of your plugins and that will work. And do make sure that all of them are null-safety enabled.

Sign up to request clarification or add additional context in comments.

Comments

0

try replacing mokito version as any as follows.

 mockito: any

then check the pubspeck.lock file and search mokito and take that version number from there and replace it in pubspec.yaml file

1 Comment

I tried that but it didn't work. it still gave me the same error
0

update the mockito package to => mockito: ^5.2.0

1 Comment

because of old version did not support null safety

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.