lvsecoto / to_string

A tools for generating toString method for class, in dart, based on `build_runner`.
7 stars 4 forks source link

Update analyzer version (dart SDK 2.12.0 compatibility) #4

Open funder7 opened 3 years ago

funder7 commented 3 years ago

Hi,

I've got a project where json_serializable package is installed, unfortunately after switching to the beta channel, I'm not able to run build_runneranymore, since apparently to_string_generatordepends on analyzer ^0.39.0, which in turn is not compatible with dart 2.12.

I tried to force analyzer version to the latest one (0.41.2), but it fails: Because to_string_generator 1.2.1 depends on analyzer ^0.39.0 and no versions of to_string_generator match >1.2.1 <2.0.0, to_string_generator ^1.2.1 requires analyzer ^0.39.0.

This is the output that I'm getting from build_runner:

[INFO] Generating build script...
[INFO] Generating build script completed, took 338ms

[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 9.2s

[INFO] Initializing inputs
[INFO] Building new asset graph...
[INFO] Building new asset graph completed, took 564ms

[INFO] Checking for unexpected pre-existing outputs....
[INFO] Checking for unexpected pre-existing outputs. completed, took 1ms

[INFO] Running build...
[WARNING] json_serializable:json_serializable on lib/pot_shared.dart:
Your current `analyzer` version may not fully support your current SDK version.

Please try upgrading to the latest `analyzer` by running `flutter packages upgrade`.

Analyzer language version: 2.10.0
SDK language version: 2.12.0

If you are getting this message and have the latest analyzer please file
an issue at https://github.com/dart-lang/sdk/issues/new with the title
"No published analyzer available for language version 2.12.0".
Please search the issue tracker first and thumbs up and/or subscribe to
existing issues if present to avoid duplicates.

[INFO] Generating SDK summary...
[SEVERE] json_serializable:json_serializable on lib/pot_shared.dart:

Bad state: Unexpected diagnostics:
/opt/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:166:25 - This requires the 'non-nullable' language feature to be enabled.
/opt/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:539:15 - This requires the 'non-nullable' language feature to be enabled.
/opt/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:390:19 - This requires the 'non-nullable' language feature to be enabled.

... (list continues in loop with these errors) 

I don't know if I'm doing something wrong, anyway I'd like to keep my project on beta channel, as I need some features included in it.

Is there any momentary fix for this problem?

thank you!

funder7 commented 3 years ago

Hi, is the package still maintained?

Having it blocked onto build_runner 1.7.1 is starting to give compatibility problems with other libraries !

lvsecoto commented 3 years ago

Hi, is the package still maintained?

Having it blocked onto build_runner 1.7.1 is starting to give compatibility problems with other libraries !

Sorry, I am too busy now. I will migrate to null-savety ASAP.

funder7 commented 3 years ago

No problem, I have created PR #5 , is not null-safety compatible, but dependencies are updated, and doesn't clash with other libraries. Sorry I'm not very confident with null-safety migration, to give some help with it.