auto_route_library icon indicating copy to clipboard operation
auto_route_library copied to clipboard

update analyzer dependency constraints to ^2.0.0

Open dokinkon opened this issue 2 years ago • 26 comments

Looks like auto_route is not compatible with the latest "analyzer" library:

Because auto_route_generator >=0.6.10 depends on analyzer >=0.40.0 <2.0.0 and json_serializable >=5.0.0 depends on analyzer ^2.0.0

Please consider update this dependency constraints, thanks.

dokinkon avatar Jul 15 '21 03:07 dokinkon

Yes please. I am still on analyzer 1.5.0 because of the following auto route generator error:

QueryParams must be nullable or have default value

@QueryParam('location') this.location = '1',

JonasKuschel avatar Jul 22 '21 10:07 JonasKuschel

Have to write complex json loader and dumper of class without json_serializable by now, really looking forward to this update.

Bryant-Yang avatar Jul 30 '21 14:07 Bryant-Yang

On it

Milad-Akarie avatar Jul 30 '21 15:07 Milad-Akarie

@Bryant-Yang @dokinkon the new flutter version still constrained to meta 1.3.0, analyzer 2.0.0 depends on meta 1.7.0. you can always override the analyzer dependency in your pubspec.

Milad-Akarie avatar Jul 31 '21 12:07 Milad-Akarie

@Milad-Akarie thanks. BTW: Is it possible to make the generated router config file more clean and readable?

Bryant-Yang avatar Jul 31 '21 18:07 Bryant-Yang

@Bryant-Yang could you give an example?

Milad-Akarie avatar Aug 01 '21 07:08 Milad-Akarie

@Milad-Akarie I mean the generated router file imports all files as alias, it's not a big deal. image

Bryant-Yang avatar Aug 01 '21 11:08 Bryant-Yang

@Bryant-Yang @dokinkon the new flutter version still constrained to meta 1.3.0, analyzer 2.0.0 depends on meta 1.7.0. you can always override the analyzer dependency in your pubspec.

how can we do that?

arafaysaleem avatar Aug 01 '21 14:08 arafaysaleem

@arafaysaleem

how can we do that?

in your pubspec file

dependency_overrides:
  analyzer: 1.5.0

Milad-Akarie avatar Aug 01 '21 14:08 Milad-Akarie

@arafaysaleem

how can we do that?

in your pubspec file

dependency_overrides:
  analyzer: 1.5.0

this throws an error regarding flutter_test depending on meta 1.3.0

arafaysaleem avatar Aug 01 '21 14:08 arafaysaleem

@arafaysaleem

how can we do that?

in your pubspec file

dependency_overrides:
  analyzer: 1.5.0

this throws an error regarding flutter_test depending on meta 1.3.0

dependency_overrides:
  analyzer: 1.5.0
  meta: 1.3.0

NarHakobyan avatar Aug 02 '21 06:08 NarHakobyan

Same issue. And dependency overrides will not work in all situations. Because the analyzer has some breaking changes. I have some conflict with json_serializable, freezed and sealed_generator.

payam-zahedi avatar Aug 03 '21 05:08 payam-zahedi

@payam-zahedi do all of these packages depend on analyzer 2.0.0?

Milad-Akarie avatar Aug 03 '21 07:08 Milad-Akarie

@NarHakobyan try this

dependency_overrides:
   meta: 1.7.0

Milad-Akarie avatar Aug 03 '21 07:08 Milad-Akarie

@Milad-Akarie thanks, but I'll be waiting for new version of auto_route, in new version of analyzer they have breaking changes, so it's not possible to use autoroute with the dependency overrides.

NarHakobyan avatar Aug 03 '21 07:08 NarHakobyan

@NarHakobyan the latest version of FLUTTER still constrained to meta 1.3.0, I can't simply upgrade. Screen Shot 2021-08-03 at 9 51 19 AM

Milad-Akarie avatar Aug 03 '21 07:08 Milad-Akarie

@Milad-Akarie what about of having an alpha branch for it and update it in separate branch? I don't know why, but freezed and json_annotation updated their libs to analizer's new version.

NarHakobyan avatar Aug 03 '21 07:08 NarHakobyan

@NarHakobyan ya I still have no idea how they got it to work with analyzer 2.0. I must be missing something.

Milad-Akarie avatar Aug 03 '21 07:08 Milad-Akarie

@Milad-Akarie this override is working for me, but autoroute gives us an error because of analyzer's breaking change (they removed one of their fields).

dependency_overrides:
  analyzer: 2.0.0
  meta: 1.7.0

NarHakobyan avatar Aug 03 '21 07:08 NarHakobyan

@payam-zahedi do all of these packages depend on analyzer 2.0.0?

Yes they are. for conflict of the meta package, I think you should only upgrade the analyzer. json_serialiable and freezed have kept their meta dependency on 1.3.0 version.

payam-zahedi avatar Aug 03 '21 08:08 payam-zahedi

@NarHakobyan what field?

Milad-Akarie avatar Aug 03 '21 08:08 Milad-Akarie

@payam-zahedi I'm not directly depending on meta package, analyzer is.

Milad-Akarie avatar Aug 03 '21 08:08 Milad-Akarie

@Milad-Akarie they removed FunctionType.element and FunctionType.typeArguments. 😄

NarHakobyan avatar Aug 03 '21 13:08 NarHakobyan

Hi @NarHakobyan, seems that I've occur the same issues with the analyzer 2.0.0, json_serializable 5.0.0 and meta 1.7.0

Trying to find a workaround for this issue while waiting any patch from @Milad-Akarie

Update: you can refer on this #648

image

luqmanhakem avatar Aug 06 '21 05:08 luqmanhakem

Hello,

I think this issue can be closed.

Now the migration must be to analyzer v4.

francipvb avatar Jun 13 '22 13:06 francipvb

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

github-actions[bot] avatar Aug 13 '22 08:08 github-actions[bot]