After a long time, I am trying to run my flutter project that used to run successfully. After doing flutter upgrade, I get the following dependency error. I have tried multiple possible fixes from similar issues I have found, but I still get similar errors. Any help is much appreciated.

Because audioplayers >=0.16.2 <0.18.0 depends on uuid ^2.2.2 and no versions of uuid match >2.2.2 <3.0.0, audioplayers >=0.16.2 <0.18.0 requires uuid 2.2.2.

And because uuid 2.2.2 depends on crypto ^2.0.0 and every version of flutter_driver from sdk depends on crypto 3.0.1, audioplayers >=0.16.2 <0.18.0 is incompatible with flutter_driver from sdk.
So, because postureapp depends on both audioplayers ^0.17.0 and flutter_driver any from sdk, version solving failed.

pub get failed (1; So, because postureapp depends on both audioplayers ^0.17.0 and flutter_driver any from sdk, version solving failed.)
exit code 1

my pubspec.yaml file:

environment:
  sdk: ">=2.2.0 <3.0.0" # ">=2.1.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^0.1.2
  image_picker: ^0.6.5
  firebase_core: ^1.0.0 #^0.7.0
  firebase_ml_vision: ^0.10.0 #^0.9.3+8
  camera: ^0.8.0 #^0.5.6+1
  smooth_page_indicator: ^0.1.5
  simple_animations: ^2.1.1
  flutter_statusbarcolor: ^0.2.3
  gradient_widgets: ^0.5.1
  time: "^1.3.0"
  audioplayers: ^0.17.0 #^0.15.1 
  path_provider: ^1.6.0 #^1.5.1
  wakelock: ^0.1.4+1
  poller: ^1.1.3
  permission_handler: ^6.1.0 
  mutex: ^1.1.0
dependency_overrides:
  path_provider: ^2.0.0 



dev_dependencies:
  pedantic: ^1.8.0
  e2e: ^0.2.1
  flutter_test:
    sdk: flutter
  flutter_driver:
    sdk: flutter
  test: any
  path: ^1.6.2
  flutter_launcher_icons: ^0.8.1
  flutter_launcher_name: ^0.0.1
  # path_provider: ^0.5.0+1

flutter_icons:
  image_path: "assets/images/logo.png"
  android: true
  ios: true

flutter_launcher_name:
  name: "MyApp"

flutter:
  uses-material-design: true

assets:
  - assets/images/
  - assets/sounds/
1

There are 1 best solutions below

0
On

Removing the version number of audioplayer, and some other libraries fixed the issue.