xsahil03x / super_enum

Create super-powered dart enums similar to sealed classes in Kotlin
https://pub.dev/packages/super_enum
MIT License
116 stars 13 forks source link

Version compatibility issues (`analyzer`, `super_enum`, `json_serializable`) #17

Closed bizz84 closed 4 years ago

bizz84 commented 4 years ago

I'm running on a project that uses super_enum, along with other codegen packages.

Relevant portion of my pubspec.yaml:

environment:
  sdk: ">=2.5.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter  
  json_annotation: any
  provider: any
  http: any
  logger: any
  intl: any
  super_enum: any
  cupertino_icons: ^0.1.2

dev_dependencies:
  flutter_test:
    sdk: flutter
  build_runner: any
  json_serializable: any
  super_enum_generator: any

Output of flutter packages get:

[weather_app_flutter] flutter packages get
Running "flutter pub get" in weather_app_flutter...             
The current Dart SDK version is 2.5.0.

Because json_serializable >=2.0.1 <2.0.2 depends on analyzer >=0.32.2 <0.35.0 and json_serializable >=1.5.1 <2.0.1 depends on analyzer >=0.32.2 <0.34.0, json_serializable >=1.5.1 <2.0.2 requires analyzer >=0.32.2 <0.35.0.

And because json_serializable >=1.0.0 <1.5.1 depends on analyzer ^0.32.2 and json_serializable >=0.5.8+1 <1.4.0 depends on build ^0.12.6, json_serializable >=0.5.8+1 <2.0.2 requires analyzer >=0.32.2 <0.35.0 or build ^0.12.6.

And because every version of super_enum_generator depends on build ^1.2.1 and json_serializable >=3.2.1 <3.2.3 depends on analyzer >=0.33.3 <0.39.0, if super_enum_generator any and json_serializable >=0.5.8+1 <2.0.2-∞ or >=3.2.1 <3.2.3-∞ then analyzer >=0.32.2 <0.39.0.

And because json_serializable >=3.1.0 <3.2.1 depends on analyzer >=0.33.3 <0.38.0 and json_serializable >=2.1.1 <3.1.0 depends on analyzer >=0.33.3 <0.37.0, if super_enum_generator any and json_serializable >=0.5.8+1 <2.0.2-∞ or >=2.1.1 <3.2.3-∞ then analyzer >=0.32.2 <0.39.0.

And because json_serializable >=2.0.2 <2.1.1 depends on analyzer >=0.33.3 <0.36.0 and json_serializable <=0.5.8 requires SDK version >=1.22.1 <2.0.0-∞, if super_enum_generator any and json_serializable <3.2.3 then analyzer >=0.32.2 <0.39.0.

And because no versions of json_serializable match >3.2.3 and every version of super_enum_generator depends on analyzer ^0.39.1, super_enum_generator is incompatible with json_serializable.

So, because weather_app_flutter depends on both json_serializable any and super_enum_generator any, version solving failed.
pub get failed (1)
exit code 1

Output of flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.9.1+hotfix.4, on Mac OS X 10.14.4 18E226, locale en-GB)

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.1)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.40.2)
[✓] Connected device (1 available)

! Doctor found issues in 1 category.

Any guidance on how to solve the incompatibilities issues?

xsahil03x commented 4 years ago

Hi @bizz84 , Thank you for reporting this issue. It has been fixed in the latest commit and you can reference it in your pubspec using git path.

  super_enum_generator:
    git:
      url: 'https://github.com/xsahil03x/super_enum.git'
      path: super_enum_generator
bizz84 commented 4 years ago

Great, that fixed it. Waiting for the next point release :)

bizz84 commented 4 years ago

I may even do a YouTube tutorial about this once the fix is updated on pub ;)

xsahil03x commented 4 years ago

Yeah sure, I will notify you once done. :+1: