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

hive_generator dartx #337

Closed
benhaxe opened this issue Jun 7, 2020 · 7 comments
Closed

hive_generator dartx #337

benhaxe opened this issue Jun 7, 2020 · 7 comments
Assignees
Labels
problem An unconfirmed bug.

Comments

@benhaxe
Copy link

benhaxe commented Jun 7, 2020

Hi, guys any news about this aside for using dependencies override?
I have this issue after upgrading the flutter today.

Because hive_generator >=0.6.0 depends on dartx ^0.2.0 which depends on quiver >=2.0.3 <2.1.0, hive_generator >=0.6.0 requires quiver >=2.0.3 <2.1.0.
And because every version of flutter_test from sdk depends on quiver 2.1.3, hive_generator >=0.6.0 is incompatible with flutter_test from sdk.
So, because psb_mobile_agent depends on both flutter_test any from sdk and hive_generator ^0.7.0, version solving failed.

@benhaxe benhaxe added the problem An unconfirmed bug. label Jun 7, 2020
@Reprevise
Copy link
Contributor

Please use the latest version from Git.

dependencies:
  hive:
  hive_flutter:
    git:
      url: git://github.com/hivedb/hive.git
      path: hive_flutter

dev_dependencies:
  hive_generator:
    git:
      url: git://github.com/hivedb/hive.git
      path: hive_generator

@yringler yringler mentioned this issue Jun 9, 2020
@yringler
Copy link

yringler commented Jun 9, 2020

This works for you?
I get an error

[just_audio_service] flutter pub get
Running "flutter pub get" in just_audio_service...              
Because every version of hive_generator from git depends on hive from hosted and just_audio_service depends on hive from git, hive_generator from git is forbidden.

So, because just_audio_service depends on hive_generator from git, version solving failed.
pub get failed (1; So, because just_audio_service depends on hive_generator from git, version solving failed.)
exit code 1

@Reprevise
Copy link
Contributor

@yringler

It's not going to work with every dependency, just use dependency_overrides.

https://dart.dev/tools/pub/dependencies#dependency-overrides

@yringler
Copy link

yringler commented Jun 10, 2020

Very cool, I didn't know about that. Thank you!

For the curious, here's a sample. Note that I specify a commit (the ref lines) to make sure there aren't any surprises, but those lines are optional. If you drop them, it'll pull from the latest changes on master.

dependency_overrides:
    hive:
      git:
        url: https://github.com/hivedb/hive
        path: hive
        ref: d7ee72537a3b7ce1284bcbf5ee5f86e617a4f6fc
    hive_generator:
      git:
        url: https://github.com/hivedb/hive
        path: hive_generator
        ref: d7ee72537a3b7ce1284bcbf5ee5f86e617a4f6fc
    hive_flutter:
      git:
        url: https://github.com/hivedb/hive
        path: hive_flutter
        ref: d7ee72537a3b7ce1284bcbf5ee5f86e617a4f6fc

@iveloff-developer
Copy link

I've had the same problem! Thank you for this solution, it works.

@giri-jeedigunta
Copy link

Very cool, I didn't know about that. Thank you!

For the curious, here's a sample. Note that I specify a commit (the ref lines) to make sure there aren't any surprises, but those lines are optional. If you drop them, it'll pull from the latest changes on master.

dependency_overrides:
    hive:
      git:
        url: https://github.com/hivedb/hive
        path: hive
        ref: d7ee72537a3b7ce1284bcbf5ee5f86e617a4f6fc
    hive_generator:
      git:
        url: https://github.com/hivedb/hive
        path: hive_generator
        ref: d7ee72537a3b7ce1284bcbf5ee5f86e617a4f6fc
    hive_flutter:
      git:
        url: https://github.com/hivedb/hive
        path: hive_flutter
        ref: d7ee72537a3b7ce1284bcbf5ee5f86e617a4f6fc

This was super helpful ... thank you !

@themisir
Copy link
Contributor

themisir commented Jul 24, 2020

This issue is fixed with v1.4.2 update.

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

No branches or pull requests

7 participants