isar-community / isar

Extremely fast, easy to use, and fully async NoSQL database for Flutter
https://isar-community.dev
Apache License 2.0
126 stars 14 forks source link

Using v3.1.3 in pubspec leads to an error #49

Closed CaptainDario closed 4 months ago

CaptainDario commented 4 months ago

Steps to Reproduce

Version solving using this repo seems to fail for me

flutter pub get
Resolving dependencies... (1.2s)
Because isar_generator >=3.1.3 <3.1.4 depends on isar from hosted on https://isar-community.dev and database_builder depends on isar from hosted on
  https://pub.isar-community.dev, isar_generator >=3.1.3 <3.1.4 is forbidden.
So, because database_builder depends on isar_generator 3.1.3, version solving failed.

My pubspec looks like this

isar_version: &isar_version 3.1.3

dependencies:
  xml: ^6.0.0
  path: ^1.8.2
  kana_kit:
    git:
      url: https://github.com/CaptainDario/kana_kit
  isar: 
    version: *isar_version
    hosted: https://pub.isar-community.dev/
  isar_flutter_libs: # contains Isar Core
    version: *isar_version
    hosted: https://pub.isar-community.dev/
  console_bars: ^1.1.0
  tuple: ^2.0.1
  async: ^2.10.0
  compute: ^1.0.2
  archive: ^3.3.2
  csv: ^5.0.2
  json_serializable: ^6.6.1
  json_annotation: ^4.8.0
  collection: ^1.17.0

dev_dependencies:
  lints: ^1.0.0
  test: ^1.16.0
  build_runner: any
  isar_generator: 
    version: *isar_version
    hosted: https://pub.isar-community.dev/

Details


vicenterusso commented 4 months ago

Try version 3.1.6

CaptainDario commented 4 months ago

This seems to work, is there also a version that makes v4 useable? 4.0.2 does not resolve.

Because database_builder depends on isar_generator 4.0.2 which doesn't match any versions, version solving failed.
vicenterusso commented 4 months ago

Can you post your full pubspec?

CaptainDario commented 4 months ago

Yeah sure, thank you for helping me!

name: database_builder
description: A starting point for Dart libraries or applications.
version: 1.0.0
publish_to: none
# homepage: https://www.example.com

environment:
  sdk: '>=2.17.0 <3.0.0'

isar_version: &isar_version 4.0.2

dependencies:
  xml: ^6.0.0
  path: ^1.8.2
  kana_kit:
    git:
      url: https://github.com/CaptainDario/kana_kit
  isar: 
    version: *isar_version
    hosted: https://pub.isar-community.dev/
  isar_flutter_libs: # contains Isar Core
    version: *isar_version
    hosted: https://pub.isar-community.dev/
  console_bars: ^1.1.0
  tuple: ^2.0.1
  async: ^2.10.0
  compute: ^1.0.2
  archive: ^3.3.2
  csv: ^5.0.2
  json_serializable: ^6.6.1
  json_annotation: ^4.8.0
  collection: ^1.17.0

dev_dependencies:
  lints: ^1.0.0
  test: ^1.16.0
  build_runner: any
  isar_generator: 
    version: *isar_version
    hosted: https://pub.isar-community.dev/
vicenterusso commented 4 months ago

You don't need isar_generator on version 4

CaptainDario commented 4 months ago

Thank you so much now it works! Maybe a migration guide would help for other people.