Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update analyzer dependency constraints to ^2.0.0 #623

Closed
dokinkon opened this issue Jul 15, 2021 · 26 comments
Closed

update analyzer dependency constraints to ^2.0.0 #623

dokinkon opened this issue Jul 15, 2021 · 26 comments

Comments

@dokinkon
Copy link

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.

@JonasKuschel
Copy link

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',

@Bryant-Yang
Copy link

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

@Milad-Akarie
Copy link
Owner

On it

@Milad-Akarie
Copy link
Owner

@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.

@Bryant-Yang
Copy link

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

@Milad-Akarie
Copy link
Owner

@Bryant-Yang could you give an example?

@Bryant-Yang
Copy link

Bryant-Yang commented Aug 1, 2021

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

@arafaysaleem
Copy link

@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?

@Milad-Akarie
Copy link
Owner

@arafaysaleem

how can we do that?

in your pubspec file

dependency_overrides:
  analyzer: 1.5.0

@arafaysaleem
Copy link

@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

@NarHakobyan
Copy link

@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

@payam-zahedi
Copy link
Contributor

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.

@Milad-Akarie
Copy link
Owner

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

@Milad-Akarie
Copy link
Owner

@NarHakobyan try this

dependency_overrides:
   meta: 1.7.0

@NarHakobyan
Copy link

@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.

@Milad-Akarie
Copy link
Owner

Milad-Akarie commented Aug 3, 2021

@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

@NarHakobyan
Copy link

@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.

@Milad-Akarie
Copy link
Owner

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

@NarHakobyan
Copy link

@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

@payam-zahedi
Copy link
Contributor

@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.

@Milad-Akarie
Copy link
Owner

@NarHakobyan what field?

@Milad-Akarie
Copy link
Owner

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

@NarHakobyan
Copy link

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

@luqmanhakem
Copy link

luqmanhakem commented Aug 6, 2021

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

@francipvb
Copy link

Hello,

I think this issue can be closed.

Now the migration must be to analyzer v4.

@github-actions
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants