pub_api_client icon indicating copy to clipboard operation
pub_api_client copied to clipboard

Dependency upgrade failed with freezed

Open polilluminato opened this issue 1 year ago • 1 comments

In one of my app I was trying to bump the version of freezed_annotation to the current version 2.1.0 and freezed version 2.1.0+1 but when I run flutter pub get the terminal shows me:

Running "flutter pub get" in pubhub...                          
Because pub_api_client 2.2.1 depends on freezed_annotation ^1.1.0 and no versions of pub_api_client match >2.2.1 <3.0.0, pub_api_client ^2.2.1 requires freezed_annotation ^1.1.0.
So, because pubhub depends on both freezed_annotation ^2.1.0 and pub_api_client ^2.2.1, version solving failed.
pub get failed (1; So, because pubhub depends on both freezed_annotation ^2.1.0 and pub_api_client ^2.2.1, version solving failed.)
exit code 1

So I have to leave freezed* versions like that:

dependencies:
  flutter:
    sdk: flutter
  ...
  freezed_annotation: ^1.1.0

dev_dependencies:
  ...
  freezed: ^1.1.1

Is it possible to upgrade freezed* versions to the latest 2.x.y?

Thanks, Alberto

polilluminato avatar Aug 08 '22 20:08 polilluminato

I cloned the pub_api_client, load it in the pubspec.yaml with:

dependencies:
  flutter:
    sdk: flutter
  ...
  #pub_api_client: ^2.2.1
  pub_api_client:
    path: ./packages/pub_api_client

and I modified the pub_api_client pubspec.yaml to upgrade packages in this way and everything seems to work fine:

dependencies:
  freezed_annotation: ^2.1.0 #upgrade
  http: ^0.13.5 #upgrade
  json_annotation: ^4.6.0 #upgrade
  oauth2: ^2.0.0
  path: ^1.8.1 #upgrade
  pubspec: ^2.3.0 #upgrade

dev_dependencies:
  build_runner: ^2.2.0 #upgrade
  build_version: ^2.1.1 #upgrade
  freezed: ^2.1.0+1 #upgrade
  json_serializable: ^6.3.1 #upgrade
  pedantic: ^1.11.0
  test: ^1.17.2
  test_cov: ^1.0.1

maybe @leoafarias could you consider upgrading the packages?

Thanks, Alberto

polilluminato avatar Aug 08 '22 20:08 polilluminato