hive_generator ^0.7.0+2 versioning issue with characters ^0.3.0 versus flutter test "characters 1.0.0"

Created on 16 Jun 2020  Â·  16Comments  Â·  Source: hivedb/hive

Got this after downloading the flutter master from last night:

Running "flutter pub get" ...
Because hive_generator >=0.6.0 depends on dartx ^0.2.0 which depends on characters ^0.3.0, hive_generator >=0.6.0 requires characters ^0.3.0.

And because every version of flutter_test from sdk depends on characters 1.0.0, hive_generator >=0.6.0 is incompatible with flutter_test from sdk.

So, because your app depends on both flutter_test any from sdk and hive_generator ^0.7.0+2, version solving failed.
pub get failed (1; So, because your app depends on both flutter_test any from sdk and hive_generator ^0.7.0+2, version solving failed.)

Right now, my solution is just to take out hive_generator from my pubspec.yaml since my data is more or less stable at this point. (and, additionally, I can edit the typeAdapters based on what the generator has created before. However, I can see where this will be an issue when I need to create something new.

problem

Most helpful comment

Hi,
I have the same issue:
Trackback:

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

Info:

  hive: ^1.4.1+1
  hive_flutter: ^0.3.0+2
  hive_generator: ^0.7.0+2
  build_runner: ^1.10.0

More info:

$ flutter doctor -v
[✓] Flutter (Channel stable, v1.17.2, on Linux, locale en_US.UTF-8)
    • Flutter version 1.17.2 at /home/or/ws/tools/sdk/flutter
    • Framework revision 5f21edf8b6 (5 weeks ago), 2020-05-28 12:44:12 -0700
    • Engine revision b851c71829
    • Dart version 2.8.3


[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /home/or/ws/tools/sdk/android/
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /home/or/ws/tools/sdk/android/
    • Java binary at: /home/or/ws/tools/ide/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Android Studio (version 4.0)
    • Android Studio at /home/or/ws/tools/ide/android-studio
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 5.1.1 (API 22) (emulator)

• No issues found!

All 16 comments

Same issue.

The solution I found is to downgrade with "flutter version v1.12.13+hotfix.7"

I am having this issue as well. I was taking a look around, and it looks like hive_generator, as well as hive_flutter are archived?

I have the same issue in Flutter 19.15 (dev channel).

same issue,

Flutter 1.20.0-1.0.pre.132 • channel master • https://github.com/flutter/flutter.git
Framework • revision 5995661777 (3 days ago) • 2020-06-19 16:15:58 -0700
Engine • revision 676cd566f7
Tools • Dart 2.9.0 (build 2.9.0-17.0.dev 7e72c9ae7e)

i have to disable hive_generator in pubspec.yaml.
had to switch to to Sembast

same issue. This has been a problem for months now. Why can't you just update it?

So, I was able to do a very hacky workaround.

  1. I downgraded to flutter channel dev.
  2. I uncommented out hive_generator in pubspec.yaml
  3. I added the following overrides:
dependency_overrides: 
  dartx: ^0.3.0
  characters: ^0.3.0
  1. I ran 'flutter packages pub run build_runner build --delete-conflicting-outputs' to generate the new typeAdapters.
  2. after it ran, I reversed everything.

It looks like it built my typeAdapter correctly. I was able to do it manually for a while, but the code is confusing for Lists of Map and I had to rely on the generator.

Hi,
I have the same issue:
Trackback:

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

Info:

  hive: ^1.4.1+1
  hive_flutter: ^0.3.0+2
  hive_generator: ^0.7.0+2
  build_runner: ^1.10.0

More info:

$ flutter doctor -v
[✓] Flutter (Channel stable, v1.17.2, on Linux, locale en_US.UTF-8)
    • Flutter version 1.17.2 at /home/or/ws/tools/sdk/flutter
    • Framework revision 5f21edf8b6 (5 weeks ago), 2020-05-28 12:44:12 -0700
    • Engine revision b851c71829
    • Dart version 2.8.3


[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /home/or/ws/tools/sdk/android/
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /home/or/ws/tools/sdk/android/
    • Java binary at: /home/or/ws/tools/ide/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Android Studio (version 4.0)
    • Android Studio at /home/or/ws/tools/ide/android-studio
    • Flutter plugin version 47.1.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 5.1.1 (API 22) (emulator)

• No issues found!

Same issue with stable channel

Does this is still happening in latest version?

Upgrading the dev_dependencies to the latest broke, but I did this:

dev_dependencies:
    hive_generator: ^0.7.0+2
    build_runner: ^1.10.0

And my app seemed to build just fine, and didn't get any issues in the pubspec. Could someone confirm this?

Upgrading the dev_dependencies to the latest broke, but I did this:

dev_dependencies:
    hive_generator: ^0.7.0+2
    build_runner: ^1.10.0

And my app seemed to build just fine, and didn't get any issues in the pubspec. Could someone confirm this?

Could you write error message here? I need to figure out which dependency causes this issue.

@TheMisir

Here's the message I get:

The current Dart SDK version is 2.9.0-21.0.dev.flutter-9dca49e71e.



Because powered_web depends on build_runner >=1.10.2 which requires SDK version >=2.10.0-0.0 <3.0.0, version solving failed.
pub get failed (1; Because powered_web depends on build_runner >=1.10.2 which requires SDK version >=2.10.0-0.0 <3.0.0, version solving failed.)
exit code 1

This is using this yaml:

dependencies:
  hive: ^1.4.2
  hive_flutter: ^0.3.1

dev_dependencies:
  hive_generator: ^0.7.1
  build_runner: ^1.10.2

I've upgraded to latest Dart/Flutter and building for web when I get this.

My environment is set to:

environment:
  sdk: ">=2.8.1 <3.0.0"

@TheMisir

Here's the message I get:

The current Dart SDK version is 2.9.0-21.0.dev.flutter-9dca49e71e.



Because powered_web depends on build_runner >=1.10.2 which requires SDK version >=2.10.0-0.0 <3.0.0, version solving failed.
pub get failed (1; Because powered_web depends on build_runner >=1.10.2 which requires SDK version >=2.10.0-0.0 <3.0.0, version solving failed.)
exit code 1

This is using this yaml:

dependencies:
  hive: ^1.4.2
  hive_flutter: ^0.3.1

dev_dependencies:
  hive_generator: ^0.7.1
  build_runner: ^1.10.2

I've upgraded to latest Dart/Flutter and building for web when I get this.

My environment is set to:

environment:
  sdk: ">=2.8.1 <3.0.0"

I think the issue is related to build_runner package rather than hive.

Could you try setting dependencies like that:

dev_dependencies:
  build_runner: ^1.10.2

dependency_overrides:
  analyzer: 0.39.14

I'm not sure this will solve the issue but worth trying.

Also this might be related to: https://github.com/dart-lang/sdk/issues/42887 and https://github.com/hivedb/hive/issues/387

@TheMisir

That looks to have solved my issue. So it looks like a Dart/Flutter issue that isn't quite done getting fixed.

@TheMisir

That looks to have solved my issue. So it looks like a Dart/Flutter issue that isn't quite done getting fixed.

Yep, the issue is: https://github.com/flutter/flutter/issues/62240

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hopheylalal picture Hopheylalal  Â·  4Comments

ProfileID picture ProfileID  Â·  4Comments

azilvl picture azilvl  Â·  3Comments

jamesdixon picture jamesdixon  Â·  3Comments

kthecoder picture kthecoder  Â·  3Comments