hive_flutter uses too old version of path, so it does not build on Flutter master 1.18.0-6.0.pre.64

Created on 17 Apr 2020  路  19Comments  路  Source: hivedb/hive

Just upgraded to latest version on Flutter master channel and hive_flutter did not like it, the build bombs due to, too old version of "path":

Because every version of flutter_test from sdk depends on path 1.7.0 and hive_flutter 0.3.0+2 depends on path >=1.6.0 <1.7.0, flutter_test from sdk is incompatible with hive_flutter 0.3.0+2.

And because no versions of hive_flutter match >0.3.0+2 <0.4.0, flutter_test from sdk is incompatible with hive_flutter ^0.3.0+2.

So, because talo depends on both hive_flutter ^0.3.0+2 and flutter_test any from sdk, version solving failed.
pub get failed (1; So, because talo depends on both hive_flutter ^0.3.0+2 and flutter_test any from sdk, version solving failed.)

Doctor summary (to see all details, run flutter doctor -v):
[鈭歖 Flutter (Channel master, v1.18.0-6.0.pre.64, on Microsoft Windows [Version 10.0.18363.657], locale en-US)
[鈭歖 Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[鈭歖 Chrome - develop for the web
[鈭歖 Visual Studio - develop for Windows (Visual Studio Community 2019 16.5.4)
[鈭歖 Android Studio (version 3.6)
[鈭歖 IntelliJ IDEA Community Edition (version 2019.2)
[鈭歖 VS Code (version 1.44.1)
[鈭歖 Connected device (4 available)

problem

Most helpful comment

Does anyone know if @leisim is ok? He's from Bavaria, the hardest-hit by coronavirus area of Germany. I hope he's doing fine.

All 19 comments

any update on this issue?

I have the same issue.

Does anyone know if @leisim is ok? He's from Bavaria, the hardest-hit by coronavirus area of Germany. I hope he's doing fine.

Can't we just use
dependency_overrides: path: 1.7.0 ?
I've done that and it works, for the moment...

@LibertyWalk this is a terrible idea it's wreaking havoc for me. Any solution for this problem ?

@LibertyWalk this is a terrible idea it's wreaking havoc for me. Any solution for this problem ?

@nicolasvahidzein, you can fork the hive project and change the path dependency in place on your account then use the packages from git like:

hive:
   git:
     url: git://github.com/your_user/hive.git
     path: hive
hive_flutter:
  git:
     url: git://github.com/your_user/hive.git
     path: hive_flutter

This is an alternate for dependency_overrides and will not impact other packages.

287 :neckbeard:

I'll just ask a rookie question: Can I manually change the pubspec.yaml of the local version I have of hive_flutter? or should I just fork it?

This is the way to go indeed:

dependency_overrides: path: 1.7.0

thanks @LibertyWalk Daniel, i apologize for what i said earlier. I did have to rebuild my entire project from a new flutter 1.17 blank project.

Any news to update the package?

For me overriding the path dependency works:

dependencies:
  flutter:
    sdk: flutter
  dio: ^3.0.9
  hive_flutter: ^0.3.0+2
  hive: ^1.4.1+1
  path: ^1.7.0

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.3

dependency_overrides:
  path: ^1.6.4

dev_dependencies:
  flutter_test:
    sdk: flutter
  hive_generator: ^0.7.0+2
  build_runner: ^1.10.0

For me overriding the path dependency works:

dependencies:
  flutter:
    sdk: flutter
  dio: ^3.0.9
  hive_flutter: ^0.3.0+2
  hive: ^1.4.1+1
  path: ^1.7.0

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.3

dependency_overrides:
  path: ^1.6.4

dev_dependencies:
  flutter_test:
    sdk: flutter
  hive_generator: ^0.7.0+2
  build_runner: ^1.10.0

This got me sorted out! thank you!

I get the following error using the above pubspec versions:

Missing concrete implementation of 'getter TypeAdapter.typeId'.
Try implementing the missing method, or make the class abstract.

For me overriding the path dependency works:

dependencies:
  flutter:
    sdk: flutter
  dio: ^3.0.9
  hive_flutter: ^0.3.0+2
  hive: ^1.4.1+1
  path: ^1.7.0

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.3

dependency_overrides:
  path: ^1.6.4

dev_dependencies:
  flutter_test:
    sdk: flutter
  hive_generator: ^0.7.0+2
  build_runner: ^1.10.0

Thanks, Work for me!

dependency_overrides - risk to have issues, hope hive will be fixed

dependency_overrides:
path: ^1.6.4

work with this. thx

Hive installation is confusing & harder.
if I override path version then it shows version error in dartx, if I override its version then it shows version error in characters.
still, version issue is not cleared. please update the version of packages used in hive

Hive installation is confusing & harder.
if I override path version then it shows version error in dartx, if I override its version then it shows version error in characters.
still, version issue is not cleared. please update the version of packages used in hive

The same for me!!!

Have you tried to upgrade to the latest version? Try running flutter pub outdated then flutter pub upgrade to get to the latest packages you depend on.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SergeShkurko picture SergeShkurko  路  4Comments

ninest picture ninest  路  3Comments

aminjoharinia picture aminjoharinia  路  3Comments

yaymalaga picture yaymalaga  路  4Comments

kaboc picture kaboc  路  3Comments