Closed rxseb closed 9 months ago
Yep, I think it is because the test package, mocktail is currently using a version of the test package 2 years old.
Yep, I think it is because the test package, mocktail is currently using a version of the test package 2 years old.
The test version constraint that mocktail has supports the latest version of package:test so that shouldn’t be an issue.
I think @omensight is right. According to the error message the conflict comes from incompatible resolution for analyzer version, which needs to be >=6.0.0 for freezed 2.4.2, but <6.0.0 for test ^1.16.
test package increased its analyzer version constraint since 1.24.4. So I guess increasing test version constraint to ^1.24.4 should make mocktail compatible with packages requiring analyzer >=6.0.0.
This is due to an incompatibility between package:test
(from mocktail
), package:analyzer
(from freezed
), and flutter_test
(from the flutter sdk). I took a closer look and I think mocktail
can safely avoid depending on package:test
with minimal impact to end users which should resolve this sort of issue moving forward (as this isn't the first time this has happened).
This should be resolved in mocktail v1.0.1
apologies for the inconvenience! 👍
Describe the bug Mocktail is not compatible with latest freezed version (2.4.2).
To Reproduce
flutter create sample_app
flutter pub add --dev mocktail
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, test >=1.16.0-nullsafety.19 <1.20.0 requires test_api 0.2.19 or analyzer >=1.0.0 <3.0.0. And because test >=1.20.0 <1.21.2 depends on test_api 0.4.9 and test >=1.21.0 <1.21.6 depends on analyzer >=2.0.0 <5.0.0, test >=1.16.0-nullsafety.19 <1.21.6 requires test_api 0.2.19 or 0.4.9 or analyzer >=1.0.0 <5.0.0. And because test >=1.21.6 <1.24.4 depends on analyzer >=2.0.0 <6.0.0 and test >=1.24.4 depends on test_api 0.6.1, test >=1.16.0-nullsafety.19 requires test_api 0.2.19 or 0.4.9 or 0.6.1 or analyzer >=1.0.0 <6.0.0. And because freezed >=2.4.2 depends on analyzer ^6.0.0 and matcher >=0.12.15 <0.12.16 depends on test_api ^0.5.0, one of freezed >=2.4.2 or test >=1.16.0-nullsafety.19 or matcher >=0.12.15 <0.12.16 must be false. And because every version of flutter_test from sdk depends on matcher 0.12.15 and mocktail >=0.1.3 depends on test ^1.16.0, one of freezed >=2.4.2 or flutter_test from sdk or mocktail >=0.1.3 must be false. And because mocktail <0.1.3 requires SDK version >=2.12.0-0 <2.17.0 and sample_app depends on flutter_test from sdk, freezed >=2.4.2 is incompatible with mocktail. So, because sample_app depends on both freezed ^2.4.2 and mocktail any, version solving failed.
name: sample_app description: A new Flutter project. publish_to: 'none' version: 1.0.0+1
environment: sdk: '>=3.0.2 <4.0.0'
dependencies: flutter: sdk: flutter cupertino_icons: ^1.0.2 freezed_annotation: ^2.4.1
dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^2.0.0 build_runner: ^2.4.6 freezed: ^2.4.2
flutter: uses-material-design: true