bloc
bloc copied to clipboard
bloc_test too old dependencies
When should we expect new release of bloc_test library with upgraded dependencies. When I am trying to import the newest version I am getting this beautifull error. Downgrading bloc_test doesnt help and I dont want to downgrade other libraries. Please provide this update as soon as possible. Cheers.

Hi @bartekwk 👋 Thanks for opening an issue!
This looks like it's a conflict between injectable_generator and flutter_test based on the error. If you remove bloc_test does the error go away?
Yes, it occurred only after adding bloc_test. I've tried to add different version of this package but every one is conflicted.
Yes, it occurred only after adding bloc_test. I've tried to add different version of this package but every one is conflicted.
Can you share your pubspec.yaml?
@bartekwk any update? Were you able to resolve the issue? If not, can you provide link to a minimal reproduction sample? Thanks!
name: mobile description: A new Flutter project.
publish_to: "none" version: 2.0.4+20
environment: sdk: ">=2.12.0 <3.0.0" flutter: "2.10.5"
dependencies: amplitude_flutter: ^3.10.0 app_settings: ^4.1.6 app_tracking_transparency: ^2.0.2+4 auto_route: ^4.0.0 auto_size_text: ^3.0.0 awesome_notifications: ^0.6.21 cached_network_image: ^3.2.0 chewie: ^1.3.3 crypto: ^3.0.2 cupertino_icons: ^1.0.5 devicelocale: ^0.5.2 dio: ^4.0.6 easy_localization: ^3.0.0 expandable_page_view: ^1.0.13 file_picker: ^4.6.1 firebase_analytics: ^9.1.10 flutter_calendar_week: ^2.1.1 firebase_core: ^1.18.0 firebase_crashlytics: ^2.8.2 firebase_dynamic_links: ^4.2.6 flutter_inappwebview: ^5.4.3+7 firebase_messaging: ^11.4.2 firebase_remote_config: ^2.0.9 firebase_storage: ^10.2.18 flutter: sdk: flutter flutter_bloc: ^8.0.1 flutter_facebook_sdk: 1.0.0 flutter_hooks: ^0.18.3 flutter_html: ^3.0.0-alpha.5 flutter_markdown: ^0.6.10 flutter_multi_formatter: ^2.5.7 flutter_native_timezone: 2.0.0 flutter_staggered_grid_view: ^0.6.1 flutter_svg: ^1.0.3 freezed_annotation: ^2.0.3 get_it: ^7.2.0 hive: ^2.2.2 image_picker: ^0.8.5+3 in_app_purchase: ^3.0.6 in_app_review: ^2.0.4 injectable: ^1.5.3 intercom_flutter: ^7.2.0 json_annotation: ^4.5.0 mockito: ^5.2.0 open_file: ^3.2.1 package_info: 2.0.2 path_provider: ^2.0.11 pdf: ^3.8.1 permission_handler: ^8.2.6 platform_device_id: ^1.0.1 platform_info: ^3.2.0 provider: ^6.0.3 printing: ^5.9.1 random_color: ^1.0.5 retrofit: ^3.0.1+1 rxdart: ^0.27.4 shared_preferences: ^2.0.15 share_plus: ^4.0.8 shimmer: 2.0.0 showcaseview: ^1.1.7 step_progress_indicator: ^1.0.2 store_redirect: ^2.0.1 syncfusion_flutter_charts: 19.2.55 syncfusion_flutter_core: 19.2.55 syncfusion_flutter_datepicker: 19.2.55 touchable: ^1.0.2 uni_links: 0.5.1 url_launcher: ^6.1.3 validators: 3.0.0 visibility_detector: ^0.3.2 webview_flutter: ^3.0.4
dev_dependencies: auto_route_generator: ^4.0.0 build_runner: ^2.1.11 change_app_package_name: ^1.1.0 flutter_launcher_icons: ^0.9.3 flutter_native_splash: ^2.1.5 flutter_test: sdk: flutter freezed: ^2.0.3+1 hive_generator: ^1.1.3 injectable_generator: ^1.5.3 json_serializable: ^6.2.0 lint: ^1.8.2 retrofit_generator: ^4.0.1
flutter_icons: image_path: "assets/images/app_icon/full_icon.png" adaptive_icon_background: "assets/images/app_icon/icon_background.png" adaptive_icon_foreground: "assets/images/app_icon/icon_content.png" ios: true android: true
flutter: uses-material-design: true
assets: - assets/translations/ - assets/images/svg/ - assets/images/svg/lines/ - assets/images/png/ - assets/images/png/courses/ - assets/images/png/quiz/ - assets/images/video/
fonts: - family: Poppins fonts: - asset: assets/fonts/Poppins-Regular.ttf weight: 400 - asset: assets/fonts/Poppins-Medium.ttf weight: 500 - asset: assets/fonts/Poppins-SemiBold.ttf weight: 600
@bartekwk I think the issue is you're on an older version of Flutter which causes an incompatibility between injectable_generator and flutter_test.
I was unable to reproduce the issue on Flutter 3.0.5 (stable) with the following pubspec.yaml
name: example
environment:
sdk: ">=2.17.0 <3.0.0"
flutter: 3.0.5
dependencies:
flutter:
sdk: flutter
dev_dependencies:
bloc_test: ^9.1.0
build_runner: ^2.2.0
flutter_test:
sdk: flutter
injectable_generator: ^1.5.4
pubspec.lock
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
_fe_analyzer_shared:
dependency: transitive
description:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "46.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "4.6.0"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.1"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.2"
bloc:
dependency: transitive
description:
name: bloc
url: "https://pub.dartlang.org"
source: hosted
version: "8.1.0"
bloc_test:
dependency: "direct dev"
description:
name: bloc_test
url: "https://pub.dartlang.org"
source: hosted
version: "9.1.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
build:
dependency: transitive
description:
name: build
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.0"
build_config:
dependency: transitive
description:
name: build_config
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
build_daemon:
dependency: transitive
description:
name: build_daemon
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.0"
build_resolvers:
dependency: transitive
description:
name: build_resolvers
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.9"
build_runner:
dependency: "direct dev"
description:
name: build_runner
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
build_runner_core:
dependency: transitive
description:
name: build_runner_core
url: "https://pub.dartlang.org"
source: hosted
version: "7.2.3"
built_collection:
dependency: transitive
description:
name: built_collection
url: "https://pub.dartlang.org"
source: hosted
version: "5.1.1"
built_value:
dependency: transitive
description:
name: built_value
url: "https://pub.dartlang.org"
source: hosted
version: "8.4.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
checked_yaml:
dependency: transitive
description:
name: checked_yaml
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
code_builder:
dependency: transitive
description:
name: code_builder
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "1.16.0"
convert:
dependency: transitive
description:
name: convert
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
coverage:
dependency: transitive
description:
name: coverage
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.2"
crypto:
dependency: transitive
description:
name: crypto
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.2"
dart_style:
dependency: transitive
description:
name: dart_style
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.3"
diff_match_patch:
dependency: transitive
description:
name: diff_match_patch
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.1"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
file:
dependency: transitive
description:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "6.1.2"
fixnum:
dependency: transitive
description:
name: fixnum
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
frontend_server_client:
dependency: transitive
description:
name: frontend_server_client
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
get_it:
dependency: transitive
description:
name: get_it
url: "https://pub.dartlang.org"
source: hosted
version: "7.2.0"
glob:
dependency: transitive
description:
name: glob
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
graphs:
dependency: transitive
description:
name: graphs
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
http_multi_server:
dependency: transitive
description:
name: http_multi_server
url: "https://pub.dartlang.org"
source: hosted
version: "3.2.1"
http_parser:
dependency: transitive
description:
name: http_parser
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.1"
injectable:
dependency: transitive
description:
name: injectable
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.3"
injectable_generator:
dependency: "direct dev"
description:
name: injectable_generator
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.4"
io:
dependency: transitive
description:
name: io
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.3"
js:
dependency: transitive
description:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.4"
json_annotation:
dependency: transitive
description:
name: json_annotation
url: "https://pub.dartlang.org"
source: hosted
version: "4.6.0"
logging:
dependency: transitive
description:
name: logging
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.11"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.4"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
mime:
dependency: transitive
description:
name: mime
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
mocktail:
dependency: transitive
description:
name: mocktail
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
node_preamble:
dependency: transitive
description:
name: node_preamble
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
package_config:
dependency: transitive
description:
name: package_config
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.1"
pool:
dependency: transitive
description:
name: pool
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.1"
pub_semver:
dependency: transitive
description:
name: pub_semver
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
pubspec_parse:
dependency: transitive
description:
name: pubspec_parse
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
shelf:
dependency: transitive
description:
name: shelf
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.2"
shelf_packages_handler:
dependency: transitive
description:
name: shelf_packages_handler
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.1"
shelf_static:
dependency: transitive
description:
name: shelf_static
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.1"
shelf_web_socket:
dependency: transitive
description:
name: shelf_web_socket
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.2"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.99"
source_gen:
dependency: transitive
description:
name: source_gen
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.2"
source_map_stack_trace:
dependency: transitive
description:
name: source_map_stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
source_maps:
dependency: transitive
description:
name: source_maps
url: "https://pub.dartlang.org"
source: hosted
version: "0.10.10"
source_span:
dependency: transitive
description:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.2"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
stream_transform:
dependency: transitive
description:
name: stream_transform
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
test:
dependency: transitive
description:
name: test
url: "https://pub.dartlang.org"
source: hosted
version: "1.21.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.9"
test_core:
dependency: transitive
description:
name: test_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.13"
timing:
dependency: transitive
description:
name: timing
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.1"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
vm_service:
dependency: transitive
description:
name: vm_service
url: "https://pub.dartlang.org"
source: hosted
version: "8.3.0"
watcher:
dependency: transitive
description:
name: watcher
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.2.0"
webkit_inspection_protocol:
dependency: transitive
description:
name: webkit_inspection_protocol
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
yaml:
dependency: transitive
description:
name: yaml
url: "https://pub.dartlang.org"
source: hosted
version: "3.1.1"
sdks:
dart: ">=2.17.0 <3.0.0"
flutter: ">=3.0.5"
This pubspec was not generating any problems because it hasnt got bloc_test package.So it couldnt be issue with incompatibility between injectable_generator and flutter_test. When I added bloc test error was thrown.
No matter what version, after adding bloc_test error was shown.
@felangel what do you think about that ?
@felangel what do you think about that ?
Can you use the pubspec.yaml I referenced above and check whether you’re able to install the dependencies?
Closing for now since there is still no actionable next steps on my end. Feel free to comment with additional information and I'm happy to continue the conversation 👍
Hi, I was also facing similar issue when adding bloc_test. In my case the real culprit was build_runner and freezed.
This fixed my issue:
build_runner: ^2.3.0
freezed: ^2.2.0
Hopefully this will be helpful for anyone who is facing the same issue.