FlutterGen / flutter_gen

The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.
https://pub.dev/packages/flutter_gen
MIT License
1.46k stars 146 forks source link

update json_annotation dependency #93

Closed EmanueleVinci closed 3 years ago

EmanueleVinci commented 3 years ago

When I run "pub get" appears this error

Because flutter_gen >=2.0.1 <2.0.2 depends on flutter_gen_core ^2.0.1 and flutter_gen >=2.0.2 depends on flutter_gen_core ^2.0.2, flutter_gen >=2.0.1 requires flutter_gen_core ^2.0.1.
And because flutter_gen_core >=2.0.1-dev.0 depends on json_annotation ^3.1.0, flutter_gen >=2.0.1 requires json_annotation ^3.1.0.
So, because your_project depends on both json_annotation ^4.0.0 and flutter_gen ^2.0.1, version solving failed.

Can you please update the dependency?

wasabeef commented 3 years ago

@EmanueleVinci Thanks for using FlutterGen. Which one are you using flutter_gen version? We released flutter_gen 2.0.2.

dart

dart pub global activate flutter_gen

brew

brew upgrade fluttergen/tap/fluttergen

build_runner

dev_dependencies:
  build_runner:
  flutter_gen_runner: ^2.0.2
EmanueleVinci commented 3 years ago

I was using 2.0.1, but with 2.0.2 I've the same problem.

pubspec.yaml

dependencies:
  flutter:
    sdk: flutter

  #Firebase
  firebase_core: ^1.0.0
  cloud_firestore: ^1.0.0
  firebase_auth: ^1.0.0
  cloud_functions: ^1.0.0
  firebase_storage: ^8.0.0
  google_sign_in: ^5.0.0
  firebase_messaging: ^9.0.0

  #Logic
  flutter_bloc: ^6.1.3

  #Utility
  cupertino_icons: ^1.0.2
  google_fonts: ^2.0.0
  json_annotation: ^4.0.0
  flutter_gen: ^2.0.2
  shared_preferences: ^2.0.3
  intl: ^0.17.0
  url_launcher: ^6.0.2
  image_picker: ^0.7.2

dev_dependencies:
  flutter_test:
    sdk: flutter

  build_runner: ^1.11.5
  json_serializable: ^4.0.2
  flutter_gen_runner: ^2.0.2

The error is always the same:

Because flutter_gen >=2.0.2 depends on flutter_gen_core ^2.0.2 which depends on json_annotation ^3.1.0, flutter_gen >=2.0.2 requires json_annotation ^3.1.0.
So, because base_project depends on both json_annotation ^4.0.0 and flutter_gen ^2.0.2, version solving failed.
pub get failed (1; So, because base_project depends on both json_annotation ^4.0.0 and flutter_gen ^2.0.2, version solving failed.)

Am I doing something wrong?

wasabeef commented 3 years ago

@EmanueleVinci I understood the issue, but we have to release a null safety version to solve it. So could you wait for the null safety version 3.0.0 maybe we will release it in a few days.

EmanueleVinci commented 3 years ago

ok, thank you!

wasabeef commented 3 years ago

@EmanueleVinci I'm sorry for late reply.

Just now we released v3.0.2 null safety so could you try it?