Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Impossible to Install bloc_test, Version Solving Failed #3110

Closed
erayerdin opened this issue Jan 3, 2022 · 6 comments
Closed

fix: Impossible to Install bloc_test, Version Solving Failed #3110

erayerdin opened this issue Jan 3, 2022 · 6 comments
Assignees
Labels
dependency This issue has an external dependency question Further information is requested

Comments

@erayerdin
Copy link

erayerdin commented Jan 3, 2022

Description
It is impossible to install bloc_test, it fails with the latest stable version of Flutter.

Steps To Reproduce

  1. Create new Flutter project.
  2. Add bloc_test to dev_dependencies. You can add the latest 9.0.2 version or even do any to let the pub deal with latest compatible version.
  3. Fail.

Expected Behavior
For it to install without any problem.

Additional Context

pubspec.yaml file:

name: myapp
description: A new Flutter project.

publish_to: 'none'

version: 0.1.0+1

environment:
  sdk: ">=2.15.1 <3.0.0"

dependencies:
  bloc: ^8.0.2
  cupertino_icons: ^1.0.2
  file_picker: ^4.3.0
  fluro: ^2.0.3
  flutter:
    sdk: flutter
  flutter_bloc: ^8.0.1
  flutter_loggy: ^2.0.1
  freezed_annotation: ^1.1.0
  get_it: ^7.2.0
  json_serializable: ^6.1.3
  loggy: ^2.0.1
  path: ^1.8.0

dev_dependencies:
  bloc_test: ^9.0.2
  build_runner: ^2.1.7
  flutter_lints: ^1.0.0
  flutter_test:
    sdk: flutter
  freezed: ^1.1.1

flutter:
  uses-material-design: true
  # To add assets to your application, add an assets section, like this:
  # assets:
  #   - images/a_dot_burr.jpeg
  #   - images/a_dot_ham.jpeg
  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.
  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages
  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

Fails with saying (if version is 9.0.2):

[myapp] flutter pub get
Running "flutter pub get" in myapp...                      
Because test >=1.16.0-nullsafety.19 <1.16.6 depends on test_api 0.2.19 and test >=1.16.6 <1.17.10 depends on analyzer ^1.0.0, test >=1.16.0-nullsafety.19 <1.17.10 requires test_api 0.2.19 or analyzer ^1.0.0.
And because test >=1.17.10 <1.20.0 depends on analyzer >=1.0.0 <3.0.0 and test >=1.20.0 depends on test_api 0.4.9, test >=1.16.0-nullsafety.19 requires test_api 0.2.19 or 0.4.9 or analyzer >=1.0.0 <3.0.0.
Because no versions of freezed match >1.1.1 <2.0.0 and freezed 1.1.1 depends on analyzer ^3.0.0, freezed ^1.1.1 requires analyzer ^3.0.0.
Thus, if freezed ^1.1.1 and test >=1.16.0-nullsafety.19 then test_api 0.2.19 or 0.4.9.
And because every version of flutter_test from sdk depends on test_api 0.4.3, one of freezed ^1.1.1 or test >=1.16.0-nullsafety.19 or flutter_test from sdk must be false.
And because myapp depends on bloc_test ^9.0.2 which depends on test ^1.16.0, freezed ^1.1.1 is incompatible with flutter_test from sdk.
So, because myapp depends on both flutter_test from sdk and freezed ^1.1.1, version solving failed.
pub get failed (1; So, because myapp depends on both flutter_test from sdk and freezed ^1.1.1, version solving failed.)
exit code 1

Fails with saying if version is set to any:

[myapp] flutter pub get
Running "flutter pub get" in myapp...                      
    Because bloc_test >=3.0.0-dev.1 <3.0.0 depends on bloc ^3.0.0-dev.1 and bloc_test >=5.0.0-dev.1 <5.0.0-dev.2 depends on bloc ^4.0.0-dev.1, bloc_test >=3.0.0-dev.1 <3.0.0 or >=5.0.0-dev.1 <5.0.0-dev.2 requires bloc ^3.0.0-dev.1 or ^4.0.0-dev.1.
    And because bloc_test >=5.0.0-dev.2 <5.0.0-dev.3 depends on bloc ^4.0.0-dev.2, bloc_test >=3.0.0-dev.1 <3.0.0 or >=5.0.0-dev.1 <5.0.0-dev.3 requires bloc ^3.0.0-dev.1 or >=4.0.0-dev.1 <5.0.0.
    And because bloc_test >=5.0.0-dev.3 <5.0.0-dev.4 depends on bloc ^4.0.0-dev.3 and bloc_test >=5.0.0-dev.4 <5.0.0 depends on bloc ^4.0.0-dev.4, bloc_test >=3.0.0-dev.1 <3.0.0 or >=5.0.0-dev.1 <5.0.0 requires bloc ^3.0.0-dev.1 or >=4.0.0-dev.1 <5.0.0.
    And because bloc_test >=6.0.0-dev.1 <6.0.0-dev.2 depends on bloc ^5.0.0-dev.6 and bloc_test >=6.0.0-dev.2 <6.0.0-dev.3 depends on bloc ^5.0.0-dev.7, bloc_test >=3.0.0-dev.1 <3.0.0 or >=5.0.0-dev.1 <5.0.0 or >=6.0.0-dev.1 <6.0.0-dev.3 requires bloc ^3.0.0-dev.1 or >=4.0.0-dev.1 <5.0.0 or >=5.0.0-dev.6 <6.0.0.
    And because bloc_test >=6.0.0-dev.3 <6.0.0-dev.4 depends on bloc ^5.0.0-dev.10 and bloc_test >=6.0.0-dev.4 <6.0.0 depends on bloc ^5.0.0-dev.11, bloc_test >=3.0.0-dev.1 <3.0.0 or >=5.0.0-dev.1 <5.0.0 or >=6.0.0-dev.1 <6.0.0 requires bloc ^3.0.0-dev.1 or >=4.0.0-dev.1 <5.0.0 or >=5.0.0-dev.6 <6.0.0.
    And because bloc_test >=7.0.0-dev.1 <7.0.0 depends on bloc ^6.0.0-dev.1 and bloc_test >=8.0.0-nullsafety.0 <8.0.0-nullsafety.2 depends on test ^1.16.0, bloc_test >=3.0.0-dev.1 <3.0.0 or >=5.0.0-dev.1 <5.0.0 or >=6.0.0-dev.1 <6.0.0 or >=7.0.0-dev.1 <7.0.0 or >=8.0.0-nullsafety.0 <8.0.0-nullsafety.2 requires bloc ^3.0.0-dev.1 or >=4.0.0-dev.1 <5.0.0 or >=5.0.0-dev.6 <6.0.0 or ^6.0.0-dev.1 or test ^1.16.0.
    And because bloc_test >=8.0.0-nullsafety.2 <8.0.0-nullsafety.5 depends on test_api ^0.2.19 and bloc_test <1.0.0 depends on bloc ^0.16.0, bloc_test <1.0.0-∞ or >=3.0.0-dev.1 <3.0.0 or >=5.0.0-dev.1 <5.0.0 or >=6.0.0-dev.1 <6.0.0 or >=7.0.0-dev.1 <7.0.0 or >=8.0.0-nullsafety.0 <8.0.0-nullsafety.5 requires bloc ^0.16.0 or ^3.0.0-dev.1 or >=4.0.0-dev.1 <5.0.0 or >=5.0.0-dev.6 <6.0.0 or ^6.0.0-dev.1 or test ^1.16.0 or test_api ^0.2.19.
    And because bloc_test ^1.0.0 depends on bloc ^1.0.0 and bloc_test >=2.0.0 <3.0.0-dev.1 depends on bloc ^2.0.0, bloc_test <3.0.0-∞ or >=5.0.0-dev.1 <5.0.0 or >=6.0.0-dev.1 <6.0.0 or >=7.0.0-dev.1 <7.0.0 or >=8.0.0-nullsafety.0 <8.0.0-nullsafety.5 requires bloc ^0.16.0 or ^1.0.0 or ^2.0.0 or ^3.0.0-dev.1 or >=4.0.0-dev.1 <5.0.0 or >=5.0.0-dev.6 <6.0.0 or ^6.0.0-dev.1 or test ^1.16.0 or test_api ^0.2.19.
    And because bloc_test >=3.0.0 <5.0.0-dev.1 depends on bloc ^3.0.0 and bloc_test >=5.0.0 <6.0.0-dev.1 depends on bloc ^4.0.0, bloc_test <6.0.0-∞ or >=7.0.0-dev.1 <7.0.0 or >=8.0.0-nullsafety.0 <8.0.0-nullsafety.5 requires bloc ^0.16.0 or ^1.0.0 or ^2.0.0 or >=3.0.0-dev.1 <4.0.0 or >=4.0.0-dev.1 <5.0.0 or >=5.0.0-dev.6 <6.0.0 or ^6.0.0-dev.1 or test ^1.16.0 or test_api ^0.2.19.
    And because bloc_test >=6.0.0 <6.0.1 depends on bloc ^5.0.0 and bloc_test >=6.0.1 <7.0.0-dev.1 depends on bloc ^5.0.1, bloc_test <7.0.0-∞ or >=8.0.0-nullsafety.0 <8.0.0-nullsafety.5 requires bloc ^0.16.0 or ^1.0.0 or ^2.0.0 or >=3.0.0-dev.1 <4.0.0 or >=4.0.0-dev.1 <5.0.0 or >=5.0.0-dev.6 <6.0.0 or ^6.0.0-dev.1 or test ^1.16.0 or test_api ^0.2.19.
(1) So, because bloc_test >=7.0.0 <8.0.0-nullsafety.0 depends on bloc ^6.0.0 and bloc_test >=8.0.0-nullsafety.5 depends on test ^1.16.0, every version of bloc_test requires bloc ^0.16.0 or ^1.0.0 or ^2.0.0 or >=3.0.0-dev.1 <4.0.0 or >=4.0.0-dev.1 <5.0.0 or >=5.0.0-dev.6 <6.0.0 or >=6.0.0-dev.1 <7.0.0 or test ^1.16.0 or test_api ^0.2.19.

    Because test >=1.16.0-nullsafety.19 <1.16.6 depends on test_api 0.2.19 and test >=1.16.6 <1.17.10 depends on analyzer ^1.0.0, test >=1.16.0-nullsafety.19 <1.17.10 requires test_api 0.2.19 or analyzer ^1.0.0.
    And because test >=1.17.10 <1.20.0 depends on analyzer >=1.0.0 <3.0.0 and test >=1.20.0 depends on test_api 0.4.9, test >=1.16.0-nullsafety.19 requires test_api 0.2.19 or 0.4.9 or analyzer >=1.0.0 <3.0.0.
    And because every version of bloc_test requires bloc ^0.16.0 or ^1.0.0 or ^2.0.0 or >=3.0.0-dev.1 <4.0.0 or >=4.0.0-dev.1 <5.0.0 or >=5.0.0-dev.6 <6.0.0 or >=6.0.0-dev.1 <7.0.0 or test ^1.16.0 or test_api ^0.2.19 (1), every version of bloc_test requires bloc ^0.16.0 or ^1.0.0 or ^2.0.0 or >=3.0.0-dev.1 <4.0.0 or >=4.0.0-dev.1 <5.0.0 or >=5.0.0-dev.6 <6.0.0 or >=6.0.0-dev.1 <7.0.0 or test_api ^0.2.19 or 0.4.9 or analyzer >=1.0.0 <3.0.0.
    Because no versions of freezed match >1.1.1 <2.0.0 and freezed 1.1.1 depends on analyzer ^3.0.0, freezed ^1.1.1 requires analyzer ^3.0.0.
    Thus, if freezed ^1.1.1 and bloc_test any then bloc ^0.16.0 or ^1.0.0 or ^2.0.0 or >=3.0.0-dev.1 <4.0.0 or >=4.0.0-dev.1 <5.0.0 or >=5.0.0-dev.6 <6.0.0 or >=6.0.0-dev.1 <7.0.0 or test_api ^0.2.19 or 0.4.9.
    And because every version of flutter_test from sdk depends on test_api 0.4.3, if freezed ^1.1.1 and bloc_test any and flutter_test from sdk then bloc ^0.16.0 or ^1.0.0 or ^2.0.0 or >=3.0.0-dev.1 <4.0.0 or >=4.0.0-dev.1 <5.0.0 or >=5.0.0-dev.6 <6.0.0 or >=6.0.0-dev.1 <7.0.0.
    And because myapp depends on both bloc ^8.0.2 and bloc_test any, freezed ^1.1.1 is incompatible with flutter_test from sdk.
    So, because myapp depends on both flutter_test from sdk and freezed ^1.1.1, version solving failed.
pub get failed (1;     So, because myapp depends on both flutter_test from sdk and freezed ^1.1.1, version solving failed.)
exit code 1

flutter --version information:

Flutter 2.8.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 77d935af4d (3 weeks ago) • 2021-12-16 08:37:33 -0800
Engine • revision 890a5fca2e
Tools • Dart 2.15.1

Installed on KDE Neon 5.23 (based on Ubuntu 20.04) with Snap.

@erayerdin erayerdin added the bug Something isn't working label Jan 3, 2022
@felangel
Copy link
Owner

felangel commented Jan 3, 2022

Hi @erayerdin 👋
Thanks for opening an issue!

It looks like the issue is caused by the fact that package:freezed depends on analyzer: ^3.0.0 which is incompatible with package:test and flutter_test on the current stable version of flutter:

name: myapp
description: A new Flutter project.
publish_to: "none"
version: 0.1.0+1

environment:
  sdk: ">=2.14.0 <3.0.0"

dev_dependencies:
  analyzer: ^3.0.0
  flutter_test:
    sdk: flutter
  test: any

flutter:
  uses-material-design: true

This appears to have been changed in freezed v1.1.1 so you can use freezed v1.1.0 and everything should work as expected:

name: myapp
description: A new Flutter project.
publish_to: 'none'
version: 0.1.0+1

environment:
  sdk: ">=2.14.0 <3.0.0"

dependencies:
  bloc: ^8.0.2
  cupertino_icons: ^1.0.2
  file_picker: ^4.3.0
  fluro: ^2.0.3
  flutter:
    sdk: flutter
  flutter_bloc: ^8.0.1
  flutter_loggy: ^2.0.1
  freezed_annotation: ^1.1.0
  get_it: ^7.2.0
  json_serializable: ^6.1.3
  loggy: ^2.0.1
  path: ^1.8.0

dev_dependencies:
  bloc_test: ^9.0.2
  build_runner: ^2.1.7
  flutter_lints: ^1.0.0
  flutter_test:
    sdk: flutter
  freezed: ">=1.0.0 <1.1.1"

flutter:
  uses-material-design: true

Let me know if that helps 👍

@felangel felangel self-assigned this Jan 3, 2022
@felangel felangel added dependency This issue has an external dependency question Further information is requested waiting for response Waiting for follow up and removed bug Something isn't working labels Jan 3, 2022
@erayerdin
Copy link
Author

Thanks for quick response @felangel. It works. Feel free to close.

@devnta
Copy link

devnta commented Jun 22, 2022

@felangel
What if I wanna use latest version of freezed? How to upgrade freezed without this issue?

@realvotum
Copy link

realvotum commented Oct 27, 2022

@NTA-trongpq

I may be late with the reply, but this dependencies stack work for for me:

  flutter:
    sdk: flutter
  json_annotation: 4.7.0
  freezed_annotation: 2.2.0
  get_it: 7.2.0
  injectable: 1.5.3
  flutter_bloc: 8.1.1

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: 2.0.0
  json_serializable: 6.5.1
  build_runner: 2.3.0
  freezed: 2.2.0
  mockito: 5.3.2
  injectable_generator: 1.5.4
  bloc_test: 9.1.0

I had to downgrade build_runner: 2.3.2 to build_runner: 2.3.0 to make things work. I think this quite up to date a stack.

@nikkijuk
Copy link

nikkijuk commented Dec 10, 2022

@felangel At my testproject this change is problematic.

build_runner: ^2.3.0 => 2.3.2
freezed: ^2.2.0 => 2.3.2

my problem might be related to this closed ticket, but I don't know if it's really related to mocktail

Running "flutter pub get" ...

Because test >=1.16.0-nullsafety.19 <1.16.6 depends on test_api 0.2.19 and test >=1.16.6 <1.17.10 depends on analyzer ^1.0.0, test >=1.16.0-nullsafety.19 <1.17.10 requires test_api 0.2.19 or analyzer ^1.0.0.
And because test >=1.17.10 <1.20.0 depends on analyzer >=1.0.0 <3.0.0 and test >=1.20.0 <1.21.2 depends on test_api 0.4.9, test >=1.16.0-nullsafety.19 <1.21.2 requires test_api 0.2.19 or 0.4.9 or analyzer >=1.0.0 <3.0.0.
And because test >=1.21.0 <1.21.6 depends on analyzer >=2.0.0 <5.0.0 and test >=1.21.6 <1.21.7 depends on test_api 0.4.14, test >=1.16.0-nullsafety.19 <1.21.7 requires test_api 0.2.19 or 0.4.9 or 0.4.14 or analyzer >=1.0.0 <5.0.0.
And because test >=1.21.7 <1.22.0 depends on test_api 0.4.15 and test >=1.22.0 <1.22.1 depends on test_api 0.4.16, test >=1.16.0-nullsafety.19 <1.22.1 requires test_api 0.2.19 or 0.4.9 or 0.4.14 or 0.4.15 or 0.4.16 or analyzer >=1.0.0 <5.0.0.
And because test >=1.22.1 depends on test_api 0.4.17 and freezed >=2.2.1 depends on analyzer ^5.2.0, if freezed >=2.2.1 and test >=1.16.0-nullsafety.19 then test_api 0.2.19 or 0.4.9 or 0.4.14 or 0.4.15 or 0.4.16 or 0.4.17.
And because every version of flutter_test from sdk depends on test_api 0.4.12 and mocktail 0.3.0 depends on test ^1.16.0, one of freezed >=2.2.1 or flutter_test from sdk or mocktail 0.3.0 must be false.
And because no versions of mocktail match >0.3.0 <0.4.0 and lifegoals depends on mocktail ^0.3.0, freezed >=2.2.1 is incompatible with flutter_test from sdk.
So, because lifegoals depends on both flutter_test from sdk and freezed ^2.3.2, version solving failed.
pub get failed (1; So, because lifegoals depends on both flutter_test from sdk and freezed ^2.3.2, version solving failed.)

@felangel
Copy link
Owner

@felangel At my testproject this change is problematic.

build_runner: ^2.3.0 => 2.3.2 freezed: ^2.2.0 => 2.3.2

my problem might be related to this closed ticket, but I don't know if it's really related to mocktail

Running "flutter pub get" ...

Because test >=1.16.0-nullsafety.19 <1.16.6 depends on test_api 0.2.19 and test >=1.16.6 <1.17.10 depends on analyzer ^1.0.0, test >=1.16.0-nullsafety.19 <1.17.10 requires test_api 0.2.19 or analyzer ^1.0.0. And because test >=1.17.10 <1.20.0 depends on analyzer >=1.0.0 <3.0.0 and test >=1.20.0 <1.21.2 depends on test_api 0.4.9, test >=1.16.0-nullsafety.19 <1.21.2 requires test_api 0.2.19 or 0.4.9 or analyzer >=1.0.0 <3.0.0. And because test >=1.21.0 <1.21.6 depends on analyzer >=2.0.0 <5.0.0 and test >=1.21.6 <1.21.7 depends on test_api 0.4.14, test >=1.16.0-nullsafety.19 <1.21.7 requires test_api 0.2.19 or 0.4.9 or 0.4.14 or analyzer >=1.0.0 <5.0.0. And because test >=1.21.7 <1.22.0 depends on test_api 0.4.15 and test >=1.22.0 <1.22.1 depends on test_api 0.4.16, test >=1.16.0-nullsafety.19 <1.22.1 requires test_api 0.2.19 or 0.4.9 or 0.4.14 or 0.4.15 or 0.4.16 or analyzer >=1.0.0 <5.0.0. And because test >=1.22.1 depends on test_api 0.4.17 and freezed >=2.2.1 depends on analyzer ^5.2.0, if freezed >=2.2.1 and test >=1.16.0-nullsafety.19 then test_api 0.2.19 or 0.4.9 or 0.4.14 or 0.4.15 or 0.4.16 or 0.4.17. And because every version of flutter_test from sdk depends on test_api 0.4.12 and mocktail 0.3.0 depends on test ^1.16.0, one of freezed >=2.2.1 or flutter_test from sdk or mocktail 0.3.0 must be false. And because no versions of mocktail match >0.3.0 <0.4.0 and lifegoals depends on mocktail ^0.3.0, freezed >=2.2.1 is incompatible with flutter_test from sdk. So, because lifegoals depends on both flutter_test from sdk and freezed ^2.3.2, version solving failed. pub get failed (1; So, because lifegoals depends on both flutter_test from sdk and freezed ^2.3.2, version solving failed.)

This is a duplicate of flutter/flutter#115284 and has been fixed on the master channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency This issue has an external dependency question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants