[bug]: Stuck with logger and freezed dependency version
Describe the bug
Hi, first of all, many thanks for your framework, it's really helpful on turn MVVM-Service architecture adoption faster. I use this in two work apps, and it turns my job much faster for at least my late 2 years, since i started to work with Flutter in projects that needs some mobile apps development. I am stuck logger library, it makes almost a year that i freezed and could not more upgrade this library, but it's starting to affect other libraries updates that users newer logger versions.
What operating system do you use?
Linux
Information about the installed tooling
❯ flutter doctor -v [✓] Flutter (Channel stable, 3.27.1, on Fedora Linux 41 (Workstation Edition) 6.12.7-200.fc41.x86_64, locale en_US.UTF-8) • Flutter version 3.27.1 on channel stable at /home/yang/.asdf/installs/flutter/3.27.1-stable • Upstream repository https://github.com/flutter/flutter.git • Framework revision 17025dd882 (3 weeks ago), 2024-12-17 03:23:09 +0900 • Engine revision cb4b5fff73 • Dart version 3.6.0 • DevTools version 2.40.2
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc1) • Android SDK at /home/yang/Android/Sdk • Platform android-35, build-tools 35.0.0-rc1 • ANDROID_HOME = /home/yang/Android/Sdk • Java binary at: /home/yang/.local/share/JetBrains/Toolbox/apps/android-studio/jbr/bin/java • Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11) • All Android licenses accepted.
[✓] Chrome - develop for the web • CHROME_EXECUTABLE = /usr/bin/microsoft-edge
[✓] Linux toolchain - develop for Linux desktop • clang version 19.1.5 (Fedora 19.1.5-1.fc41) • cmake version 3.30.5 • ninja version 1.12.1 • pkg-config version 2.3.0
[✓] Android Studio (version 2024.2) • Android Studio at /home/yang/.local/share/JetBrains/Toolbox/apps/android-studio • Flutter plugin version 83.0.3 • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • android-studio-dir = /home/yang/.local/share/JetBrains/Toolbox/apps/android-studio • Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.2) • IntelliJ at /home/yang/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.96.2) • VS Code at /usr/share/code • Flutter extension version 3.102.0
[✓] Connected device (2 available) • Linux (desktop) • linux • linux-x64 • Fedora Linux 41 (Workstation Edition) 6.12.7-200.fc41.x86_64 • Chrome (web) • chrome • web-javascript • Microsoft Edge 131.0.2903.112
[✓] Network resources • All expected network resources are available.
Steps to reproduce the issue
- Create a project based on stacked cli.
- Install logger (2.5.0) version
Expected behavior
dart pub get Resolving dependencies... Because stacked_generator 1.6.1 depends on logger ^1.1.0 and tourism_inventory depends on logger 2.5.0, stacked_generator 1.6.1 is forbidden. So, because tourism_inventory depends on stacked_generator 1.6.1, version solving failed.
You can try one of the following suggestions to make the pubspec resolve:
- Try upgrading your constraint on stacked_generator: dart pub add dev:stacked_generator:^2.0.0-pre.1
- Consider downgrading your constraint on logger: dart pub add logger:^1.4.0
Screenshots
Additional Context
Also, the Freezed generator has some conflicts
Because stacked_generator 2.0.0-pre.1 depends on source_gen ^1.2.7 and freezed >=2.5.8 <3.0.0-0.0.dev depends on source_gen ^2.0.0, stacked_generator 2.0.0-pre.1 is incompatible with freezed >=2.5.8 <3.0.0-0.0.dev.
So, because tourism_inventory depends on both freezed 2.5.8 and stacked_generator 2.0.0-pre.1, version solving failed.
I have the same issue with stacked_generator: 1.6.1:
[bluetooth_app] flutter pub get --no-example
Resolving dependencies...
Because every version of collections_appwrite from path depends on core from git which depends on logger ^2.3.0, every version of collections_appwrite from path requires logger ^2.3.0.
And because stacked_generator 1.6.1 depends on logger ^1.1.0 and no versions of stacked_generator match >1.6.1 <2.0.0, collections_appwrite from path is incompatible with stacked_generator ^1.6.1.
So, because bluetooth_app depends on both stacked_generator ^1.6.1 and collections_appwrite from path, version solving failed.
Failed to update packages.
exit code 1
My current workaround is to downgrade the stacked_generator dependency to 1.6.0 where this isn't an issue.
That said, I believe that logger is now up to version 2.5.0, and with its heavy integration into the rest of the stacked framework, this dependency issue should probably be fixed.
Have we updated this yet? We're not actively monitoring the package issues as much unless we experience issues in production.
@CordMemescape let me know on the slack if you're still experiencing this I feel like we're on latest logger with our code since I'm seeing deprecation notices for their verbose logs and the new trace method.
Please reopen if not the case
stacked --version
1.14.0
I used stacked create app test_app_new and this is the unedited pubspec.yaml for the project:
name: test_app_new
description: A new Flutter project.
publish_to: 'none'
version: 0.1.0
environment:
sdk: '>=3.0.3 <4.0.0'
dependencies:
flutter:
sdk: flutter
stacked: ^3.4.0
stacked_services: ^1.1.0
dev_dependencies:
build_runner: ^2.4.5
flutter_test:
sdk: flutter
flutter_lints: ^2.0.0
mockito: ^5.4.1
stacked_generator: ^1.3.3
golden_toolkit: ^0.15.0
flutter:
uses-material-design: true
This pub get runs fine and the project builds. I notice golden_toolkit is now included as a dev_dependency. I've never seen this before and it appears to be discontinued. If you run flutter pub upgrade you will see golden_toolkit's current status:
Resolving dependencies...
Downloading packages...
_fe_analyzer_shared 76.0.0 (82.0.0 available)
analyzer 6.11.0 (7.4.4 available)
async 2.12.0 (2.13.0 available)
dart_style 2.3.8 (3.0.1 available)
fake_async 1.3.2 (1.3.3 available)
flutter_lints 2.0.3 (5.0.0 available)
freezed_annotation 2.4.4 (3.0.0 available)
golden_toolkit 0.15.0 (discontinued)
leak_tracker 10.0.8 (11.0.1 available)
leak_tracker_flutter_testing 3.0.9 (3.0.10 available)
leak_tracker_testing 3.0.1 (3.0.2 available)
lints 2.1.1 (6.0.0 available)
logger 1.4.0 (2.5.0 available)
material_color_utilities 0.11.1 (0.12.0 available)
mockito 5.4.5 (5.4.6 available)
source_gen 1.5.0 (2.0.0 available)
vector_math 2.1.4 (2.1.5 available)
vm_service 14.3.1 (15.0.0 available)
No dependencies changed.
1 package is discontinued.
17 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
Updating all the pubspec.yaml dependencies to the latest gives you:
name: test_app_new
description: A new Flutter project.
publish_to: 'none'
version: 0.1.0
environment:
sdk: '>=3.0.3 <4.0.0'
dependencies:
flutter:
sdk: flutter
stacked: ^3.4.4
stacked_services: ^1.6.0
dev_dependencies:
build_runner: ^2.4.15
flutter_test:
sdk: flutter
flutter_lints: ^5.0.0
mockito: ^5.4.6
stacked_generator: ^1.6.1
golden_toolkit: ^0.15.0
flutter:
uses-material-design: true
But pub get fails with the following errors:
[test_app_new] flutter pub get --no-example
Resolving dependencies...
Because no versions of stacked_generator match >1.6.1 <2.0.0 and stacked_generator 1.6.1 depends on analyzer ^6.3.0, stacked_generator ^1.6.1 requires analyzer ^6.3.0.
And because mockito >=5.4.6 depends on analyzer ^7.4.1, stacked_generator ^1.6.1 is incompatible with mockito >=5.4.6.
So, because test_app_new depends on both mockito ^5.4.6 and stacked_generator ^1.6.1, version solving failed.
You can try the following suggestion to make the pubspec resolve:
* Consider downgrading your constraint on mockito: flutter pub add dev:mockito:^5.4.5
Failed to update packages.
exit code 1
Obviously this can be worked around by downgrading mockito or adding a dependency_override for analyzer. However, adding logger: ^2.5.0 into the mix then results in:
[test_app_new] flutter pub get --no-example
Resolving dependencies...
Because stacked_generator 1.6.1 depends on logger ^1.1.0 and no versions of stacked_generator match >1.6.1 <2.0.0, stacked_generator ^1.6.1 requires logger ^1.1.0.
So, because test_app_new depends on both logger ^2.5.0 and stacked_generator ^1.6.1, version solving failed.
You can try one of the following suggestions to make the pubspec resolve:
* Try upgrading your constraint on stacked_generator: flutter pub add dev:stacked_generator:^2.0.0-pre.1
* Consider downgrading your constraint on logger: flutter pub add logger:^1.4.0
Failed to update packages.
exit code 1
To make matters more complicated, if I downgrade to stacked_services ^1.6.0, pub get it works again:
[test_app_new] flutter pub get --no-example
Resolving dependencies...
Downloading packages...
! analyzer 7.4.4 (overridden)
async 2.12.0 (2.13.0 available)
dart_style 2.3.8 (3.0.1 available)
fake_async 1.3.2 (1.3.3 available)
freezed_annotation 2.4.4 (3.0.0 available)
leak_tracker 10.0.8 (11.0.1 available)
leak_tracker_flutter_testing 3.0.9 (3.0.10 available)
leak_tracker_testing 3.0.1 (3.0.2 available)
lints 5.1.1 (6.0.0 available)
material_color_utilities 0.11.1 (0.12.0 available)
source_gen 1.5.0 (2.0.0 available)
stacked_generator 1.6.1-pre.1 (1.6.1 available)
vector_math 2.1.4 (2.1.5 available)
vm_service 14.3.1 (15.0.0 available)
Got dependencies!
13 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
exit code 0
It seems that stacked_services ^1.6.1 is pinned to logger ^1.1.0 while stacked_services ^1.6.0 is fine with later versions of logger.