Home > Net >  Because every version of alpha_vantage_package depends on http ^0.12.0 4 and front depends on http ^
Because every version of alpha_vantage_package depends on http ^0.12.0 4 and front depends on http ^

Time:02-22

I tried to install alpha_vantage and got the following error:

Because every version of alpha_vantage_package depends on http ^0.12.0 4 and front depends on http ^0.13.4, alpha_vantage_package is forbidden. So, because front depends on alpha_vantage_package ^1.0.0, version solving failed. pub get failed (1; So, because front depends on alpha_vantage_package ^1.0.0, version solving failed.) exit code 1

This is my pubspec.yaml file:


name: front
description: A new Flutter project.

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0 1

environment:
  sdk: ">=2.15.0-116.0.dev <3.0.0"


dependencies:
  flutter:
    sdk: flutter
  http: ^0.13.4
  shared_preferences: ^2.0.11
  get: ^4.6.1
  google_fonts: ^2.1.1
  universal_platform: ^1.0.0 1
  alpha_vantage_package: ^1.0.0


  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter


  flutter_lints: ^1.0.0

flutter:

  uses-material-design: true

CodePudding user response:

alpha_vantage_package was created two years ago and had no updates since then, hence its dependencies need to be updated.

I've created PR to the original repository with dependency updates, maybe at some point the author will publish an update for the package.

Meanwhile, you may use the package from my repo. Put this into pubspec.yaml:

  alpha_vantage_package:
    git:
      url: https://github.com/olexale/alpha_vantage_package

CodePudding user response:

if you get this error which is very common as the packages get updated frequently and not every version matches with other packages. It means alpha_vantage_package depends on a dependency with a version lower than you specified in another dependency.

To solve this, open pubspec.yaml, and remove the version number of the problem dependency:

Example:

Change

alpha_vantage_package : ^1.0.0 --> remove this number To:

alpha_vantage_package:

and I can also see in pubdev that alpha_vantage_package is not updated to null safety. Try not to use this package as its latest update was 2 years ago.

  • Related