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

Dependency conflict: hive_generator ^2.0.1 incompatible with json_serializable ^6.9.2 #1324

Open
dwzrlp opened this issue Dec 20, 2024 · 2 comments

Comments

@dwzrlp
Copy link

dwzrlp commented Dec 20, 2024

There is a dependency conflict when using hive_generator version ^2.0.1 alongside json_serializable version ^6.9.2 due to differing source_gen version requirements:

Because hive_generator 2.0.1 depends on source_gen ^1.0.0 and json_serializable 6.9.2 depends on source_gen ^2.0.0, json_serializable ^6.9.2 is incompatible with hive_generator ^2.0.1.
So, because smart_by_jarod depends on both hive_generator ^2.0.1 and json_serializable ^6.9.2, version solving failed.

Environment:
• Flutter version: 3.27.1 (stable)
• Dart version: 3.6.0
• OS: macOS 15.2 (darwin-arm64)

@alessionobile
Copy link

Same problem here. Solved it by forking and bumping source_gen versions: https://github.com/alessionobile/hive/tree/legacy/hive_generator

you can reference the repo on your pubspec.yaml (ref: legacy, path: hive_generator/).

I wonder if Hive is still in active development? @simc ?

@AlexSeednov
Copy link

Or you can just override this dependency in your app's pubspec.yaml dependency_overrides sector between dependencies and dev_dependencies:

dependencies:
  ...

dependency_overrides:
  source_gen: 2.0.0

dev_dependencies:
  ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants