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

The value 'null' can't be assigned to the parameter type 'I18nOption' because 'I18nOption' is not nullable. #22

Open
kasperado1 opened this issue Mar 1, 2021 · 1 comment

Comments

@kasperado1
Copy link

kasperado1 commented Mar 1, 2021

Hello,

Getting the following error when trying to run flutter pub run gen_lang:generate

Failed to precompile gen_lang:generate:
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

 - package:args
 - package:gen_lang
 - package:ansicolor

For solutions, see https://dart.dev/go/unsound-null-safety
/c:/flutter/.pub-cache/hosted/pub.dartlang.org/gen_lang-0.1.3/bin/generate.dart:17:35: Error: The value 'null' can't be assigned to the p
arameter type 'I18nOption' because 'I18nOption' is not nullable.
 - 'I18nOption' is from 'package:gen_lang/core_18n.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/gen_lang-0.1.3/lib/core_18n.dar
t').
  var parser = _generateArgParser(null);
                                  ^
pub finished with exit code 1

Running flutter pub run --no-sound-null-safety gen_lang:generate still gives the same error:

/c:/flutter/.pub-cache/hosted/pub.dartlang.org/gen_lang-0.1.3/bin/generate.dart:17:35: Error: The value 'null' can't be assigned to the p
arameter type 'I18nOption' because 'I18nOption' is not nullable.
 - 'I18nOption' is from 'package:gen_lang/core_18n.dart' ('/C:/flutter/.pub-cache/hosted/pub.dartlang.org/gen_lang-0.1.3/lib/core_18n.dar
t').
  var parser = _generateArgParser(null);
                                  ^
pub finished with exit code 254

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, 1.27.0-4.0.pre, on Microsoft Windows [Version 10.0.19042.804], locale en-AU)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] Connected device (3 available)

• No issues found!

Thanks!
Damian

@LaurentMalmendier
Copy link

I had the same issue.
I ran flutter pub get then flutter pub run build_runner build

Then flutter pub run gen_lang:generate worked

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

No branches or pull requests

2 participants