I'm getting this error, but running $ flutter gen-l10n in the terminal works fine.
I do have an unusual setup. I have a sub package that has the localization code.
arb-dir: localizations/lib/arb // localizations is my sub package
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
nullable-getter: false
synthetic-package: false
output-dir: localizations/lib/l10n // localizations is my sub package
arb-dir: lib/arb
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
nullable-getter: false
synthetic-package: false
output-dir: lib/l10n
Attempted to generate localizations code without having the flutter: generate flag turned on.
Check pubspec.yaml and ensure that flutter: generate: true has been added and rebuild the project. Otherwise, the localizations source code will not be importable.