hive_generator ^1.0.0 requires build ^1.5.2

Created on 19 Mar 2021  路  12Comments  路  Source: hivedb/hive

In case of updating json_serializable to 4.0.3 or etc exception appear:

Because no versions of hive_generator match >1.0.0 <2.0.0 and hive_generator 1.0.0 depends on build ^1.5.2, hive_generator ^1.0.0 requires build ^1.5.2.
And because json_serializable >=4.0.3 depends on build ^2.0.0, hive_generator ^1.0.0 is incompatible with json_serializable >=4.0.3.
So, because workshop depends on both json_serializable ^4.0.3 and hive_generator ^1.0.0, version solving failed.
pub get failed (1; So, because workshop depends on both json_serializable ^4.0.3 and hive_generator ^1.0.0, version solving failed.)
problem

Most helpful comment

@vandir
dependency_overrides is very bad and dangerous workaround - and is not really issue fix!
and packages downgrade is not solution as well!

If something works, it's a solution. That's how all the softwares in the world released. Otherwise it's not possible to complete any project without doing workarounds like that. Perfect is the enemy of good.

All 12 comments

same issue

597 Please just look at the latest open issues instead of opening a new one

@vandir #597 had been closed but issue had not been fixed!

If anyone has the same problem please replace the following lines:

dev_dependencies:
  hive_generator: ^1.0.0
  build_runner: ^1.12.1

with:

dev_dependencies:
  hive_generator:
  build_runner:

This is not a dependency_overrides, I've just removed the versions from dev_dependencies. Anyway it's just a temp fix. The alternative is to import the last commit directly from github or wait for the next update to be released. And anyway I'm just trying to help you, it's absurd to get a down like for it.

hello, any progress on this issue?

Currently I would suggest using dependency_overrides or downgrading to last stable version in order to temporarily suppress this issue. There was dependency incompatibility issues between some packages that was made by dart team which hive_generator uses for code generation. So that's why some dependencies are incompatible.

@vandir
dependency_overrides is very bad and dangerous workaround - and is not really issue fix!
and packages downgrade is not solution as well!

If something works, it's a solution. That's how all the softwares in the world released. Otherwise it's not possible to complete any project without doing workarounds like that. Perfect is the enemy of good.

Any ETA on that by any chance?
I needed to downgrades a lot of dependencies on my project because of the hive generator and with null safety turned on it's pretty painful.

Suggestion how to temporarily solve it and keep the rest of my dependencies updated, very welcome :)

@vandir
dependency_overrides is very bad and dangerous workaround - and is not really issue fix!
and packages downgrade is not solution as well!

If something works, it's a solution. That's how all the softwares in the world released. Otherwise it's not possible to complete any project without doing workarounds like that. Perfect is the enemy of good.

Unfortunately this doesn't work, if at least one another package require build ^2.0.0. 鈽癸笍

Any ETA on that by any chance?
I needed to downgrades a lot of dependencies on my project because of the hive generator and with null safety turned on it's pretty painful.

Suggestion how to temporarily solve it and keep the rest of my dependencies updated, very welcome :)

The fix is already available on GitHub, so change your pubspec.yaml dev_dependencies to:

dev_dependencies:
  hive_generator:  # ^1.0.0 with a dependency fix
    git:
      url: https://github.com/hivedb/hive.git
      path: hive_generator/
      ref: 0a66d8668d199a09a82c2d49a3d914fef7cb14c5

Fixed on 1.0.1

dev_dependencies:
  hive_generator: ^1.0.1
Was this page helpful?
0 / 5 - 0 ratings

Related issues

kthecoder picture kthecoder  路  3Comments

yannickvg picture yannickvg  路  4Comments

cachapa picture cachapa  路  4Comments

juandiago picture juandiago  路  4Comments

SergeShkurko picture SergeShkurko  路  4Comments