flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
161.86k stars 26.57k forks source link

flutter gen-l10n through CLI - synthetic-package error #145974

Closed sahilmahi closed 1 month ago

sahilmahi commented 1 month ago

I'm trying to generate Localizations files with command gen-l10n.

The generated files are being generated, but they're in .dart_tools/flutter_gen/genl10n

The generator creates a synthetic package, but i can't set it to false in the arguments. '''--synthetic-package=false''' is not working. image

How i can set to false? image

Expected results

generate the localizations files in the directory specified

Actual results

The generator creates a synthetic package

Code sample

Code sample ``` flutter gen-l10n --arb-dir=lib\l10n\portafoglio --output-dir=lib\l10n\portafoglio\generated --template-arb-file=portafoglio_it.arb --output-localization-file=portafoglio_localizations.dart --output-class=PortafoglioLocalizations --synthetic-package=false ```

Flutter Doctor output

Doctor output ```console [√] Flutter (Channel stable, 3.19.5, on Microsoft Windows [Versione 10.0.22631.3296], locale it-IT) • Flutter version 3.19.5 on channel stable at C:\src\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 300451adae (33 hours ago), 2024-03-27 21:54:07 -0500 • Engine revision e76c956498 • Dart version 3.3.3 • DevTools version 2.31.1 [√] Windows Version (Installed version of Windows is version 10 or higher) [!] Android toolchain - develop for Android devices (Android SDK version 33.0.1) • Android SDK at C:\Users\STB010\AppData\Local\Android\sdk X cmdline-tools component is missing Run `path/to/sdkmanager --install "cmdline-tools;latest"` See https://developer.android.com/studio/command-line for more details. X Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses. See https://flutter.dev/docs/get-started/install/windows#android-setup for more details. [√] Chrome - develop for the web • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe [√] Visual Studio - develop Windows apps (Visual Studio Professional 2022 17.8.5) • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Professional • Visual Studio Professional 2022 version 17.8.34511.84 • Windows 10 SDK version 10.0.19041.0 [√] Android Studio (version 2021.3) • Android Studio at C:\Program Files\Android\Android Studio1 • Flutter plugin can be installed from: https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866) [√] VS Code (version 1.87.2) • VS Code at C:\Users\STB010\AppData\Local\Programs\Microsoft VS Code • Flutter extension version 3.84.0 [√] Connected device (3 available) • Windows (desktop) • windows • windows-x64 • Microsoft Windows [Versione 10.0.22631.3296] • Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.60 • Edge (web) • edge • web-javascript • Microsoft Edge 122.0.2365.92 [√] Network resources • All expected network resources are available. ```
sahilmahi commented 1 month ago

Sorry my fault, the correct way to off synthetic package is:

--no-synthetic-package
github-actions[bot] commented 2 weeks ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.