3
votes

Here's my pubspec.yaml:

version: 1.0.0+1

environment:
  sdk: ">=2.3.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  shared_preferences: ^0.5.7+2
  hive: ^1.4.1+1
  hive_flutter: ^0.3.0+2
  path: ^1.6.4
  cupertino_icons: ^0.1.2
  firebase_core: ^0.4.4+3
  firebase_auth: ^0.15.5+3
  cloud_firestore: ^0.13.4+2
  cloud_functions: ^0.4.2+3

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

flutter:
  assets:
    - assets/images/
  uses-material-design: true

And, Here is the error message:

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 callshield depends on both hive_generator ^0.7.0+2 and flutter_test any from sdk, version solving failed. pub get failed (1; So, because callshield depends on both hive_generator ^0.7.0+2 and flutter_test any from sdk, version solving failed.)

Removing hive_generator will allow pub get to not error. I don't know my way around pubspec and the dependencies to solve this. Is there a way to add hive_generator to my current configuration? Would switching to beta channel help?

My current environment: Flutter 1.17.1 stable channel Dart 2.8.2

2
Dropping Hive and using Sembast. - orgreeno

2 Answers

6
votes

Add lines bellow to your PubSpec.yaml file and It works for me:

dependency_overrides:
  dartx: ^0.3.0
0
votes

I was facing the similar issue, I have just override dartx and path dependency and it works like a charm. My PubSpec.yaml look like this after overriding the dependencies:

dependencies:
  flutter:
    sdk: flutter
  dio: ^3.0.9
  hive: ^1.4.1+1
  hive_flutter: ^0.3.0+1
  cupertino_icons: ^0.1.3    

dependency_overrides:
  dartx: ^0.3.0  
  path: ^1.7.0

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

Hope it helps. The Overriding Dependency is the Temporary Solution Recommended by The Author himself here