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: Using dart_code_metrics and bloc_test creates a dependency problem #3688

Closed
quoc-huynh-cosee opened this issue Jan 16, 2023 · 1 comment
Assignees
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@quoc-huynh-cosee
Copy link

Description
If I use the latest version of dart_code_metrics and bloc_test, I'm getting a dependency problem.

Steps To Reproduce

  1. Create an empty project with these dependencies.
dev_dependencies:
  flutter_test:
    sdk: flutter

  dart_code_metrics: ^5.4.0
  bloc_test: ^9.1.0
  1. Run flutter pub get
  2. This error will be printed:
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 analyzer >=1.0.0 <3.0.0 or test_api 0.2.19 or 0.4.9.
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 analyzer >=1.0.0 <5.0.0 or test_api 0.2.19 or 0.4.9 or 0.4.14.
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 analyzer >=1.0.0 <5.0.0 or test_api 0.2.19 or 0.4.9 or 0.4.14 or 0.4.15 or 0.4.16.
And because test >=1.22.1 <1.22.2 depends on test_api 0.4.17 and test >=1.22.2 depends on test_api 0.4.18, test >=1.16.0-nullsafety.19 requires 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 or 0.4.18 or analyzer >=1.0.0 <5.0.0.
Because no versions of dart_code_metrics match >5.4.0 <6.0.0 and dart_code_metrics 5.4.0 depends on analyzer >=5.1.0 <5.4.0, dart_code_metrics ^5.4.0 requires analyzer >=5.1.0 <5.4.0.
Thus, if dart_code_metrics ^5.4.0 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 or 0.4.18.
And because bloc_test >=8.0.0-nullsafety.5 depends on test ^1.16.0, if dart_code_metrics ^5.4.0 and bloc_test >=8.0.0-nullsafety.5 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 or 0.4.18.
And because untitled depends on flutter_test from sdk which depends on test_api 0.4.12, dart_code_metrics ^5.4.0 is incompatible with bloc_test >=8.0.0-nullsafety.5.
So, because untitled depends on both dart_code_metrics ^5.4.0 and bloc_test ^9.1.0, version solving failed.
pub get failed (1; So, because untitled depends on both dart_code_metrics ^5.4.0 and bloc_test ^9.1.0, version solving failed.)

Expected Behavior
Both packages are compatible with each other.

@tenhobi
Copy link
Collaborator

tenhobi commented Jan 22, 2023

Hello, this seems like a similar issue to felangel/mocktail#178 (comment), you can find a temporary fix there.

@felangel felangel added the duplicate This issue or pull request already exists label Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants