Related to https://github.com/rrousselGit/freezed/issues/211
I'm running flutter pub run build_runner build, but it never completes due to these errors:
[SEVERE] freezed:freezed on lib/app/abstract/abstract_route_factory.dart:
Bad state: Unexpected diagnostics:
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:119:41 - This requires the 'non-nullable' language feature to be enabled.
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:152:17 - This requires the 'non-nullable' language feature to be enabled.
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:88:62 - This requires the 'non-nullable' language feature to be enabled.
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:153:38 - This requires the 'non-nullable' language feature to be enabled.
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:186:51 - This requires the 'non-nullable' language feature to be enabled.
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:133:32 - This requires the 'non-nullable' language feature to be enabled.
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:154:25 - This requires the 'non-nullable' language feature to be enabled.
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:18:17 - This requires the 'non-nullable' language feature to be enabled.
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:64:4 - This requires the 'non-nullable' language feature to be enabled.
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:168:32 - This requires the 'non-nullable' language feature to be enabled.
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:47:14 - This requires the 'non-nullable' language feature to be enabled.
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:159:38 - This requires the 'non-nullable' language feature to be enabled.
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:132:37 - This requires the 'non-nullable' language feature to be enabled.
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:118:48 - This requires the 'non-nullable' language feature to be enabled.
/Users/andrey/flutter/bin/cache/pkg/sky_engine/lib/ui/channel_buffers.dart:19:11 - This requires the 'non-nullable' language feature to be enabled.
This works in my case.
# pubspec.yaml
dev_dependencies:
analyzer: 0.39.14
The issue mentioned seems to say that this is caused by build_runner, and is fixed in the latest version
Have you tried using the latest version?
It works well with dev channel latest(1.21.0-7.0.pre) and latest analyzer(0.39.16), thanks to https://github.com/flutter/flutter/issues/62146#issuecomment-670618946.
❯ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, 1.21.0-7.0.pre, on macOS 11.0 20A5343i, locale en-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 12.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.47.3)
[✓] Connected device (4 available)
! Device PM1LHMA832902176 is not authorized.
You might need to check your device for an authorization dialog.
• No issues found!
flutter pub upgrade solved issue in my case after upgrade to 1.20.1 on channel stable
Most helpful comment
This works in my case.