-
Notifications
You must be signed in to change notification settings - Fork 4
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
I cannot generate Applocalization.g.dart file from running "dart pub run build_runner build --delete-conflicting-outputs" command #33
Comments
Hey @maazoly1, are you able to run the example project in the package? |
Hello Brother @kwado-tech thanks for reply! Then I saw that app_localizations.g.dart file is not generated so I run this command
|
@maazoly1 the error you mentioned means theres a conflict generating multiple files. You can create a simple reproducible example uploaded to github for me to take a look. |
Platform: Macbook M1 Air
After this iam getting this error |
Hey @maazoly1, l10n_mapper package does not support generation for synthetic package i.e when the file is generated in the We can change this to generate localization files in the same directory as translations by including the following in the Add to existing l10n.yaml synthetic-package: false
output-dir: lib/presentation/localization/gen_l10n Contents of l10n.yaml arb-dir: lib/presentation/localization/l10n
template-arb-file: app_en.arb
output-localization-file: app_localizations.dart
synthetic-package: false
output-dir: lib/presentation/localization/gen_l10n This means all generated localization files will reside in Indicate if this resolves your issues |
I want to use this package to dynamically parse translation key.
So i have followed Every step
I Got error when i try to install this package from vscode,
So then i copy and paste the name of package in pubspec.yaml
After I run this command "dart pub global activate l10n_mapper_generator" which was successfull.
Then I saw that app_localizations.g.dart file is not generated so I run this command
"dart pub run build_runner build --delete-conflicting-outputs"
So Here i got this error,
Deprecated. Use
dart run
instead.[INFO] Generating build script completed, took 187ms
[WARNING] Invalidated precompiled build script due to missing asset graph.
[INFO] Precompiling build script... completed, took 815ms
[SEVERE] Conflicting outputs
Both source_gen:combining_builder and l10n_mapper_generator:l10n_mapper_builder may output lib/config/environment_config.g.dart. Potential outputs must be unique across all builders. See https://github.com/dart-lang/build/blob/master/docs/faq.md#why-do-builders-need-unique-outputs
So i have made a build.yaml file and add this lines of code
build.yaml
targets:
$default:
builders:
l10n_mapper_generator:l10n_mapper_builder:
enabled: true # enables or disables the builder
options:
l10n: true # optional default - true
locale: true # optional default - true
parseL10n: true # optional default - true
message: "Translation key not found!" # optional default - null
again i run flutter gen-l10n and after this i run this "dart pub run build_runner build --delete-conflicting-outputs" again with same error
This is my pubspec.yaml file all dependecies,
dependencies:
flutter:
sdk: flutter
provider:
http:
google_maps_flutter:
google_places_flutter:
intl:
flutter_flavor:
image_picker:
permission_handler:
mime:
geolocator:
location:
onesignal_flutter:
shared_preferences:
url_launcher:
isar:
version: *isar_version
hosted: https://pub.isar-community.dev/
isar_flutter_libs: # contains Isar Core
version: *isar_version
hosted: https://pub.isar-community.dev/
path_provider:
webview_flutter:
lottie:
open_file:
flutter_contacts:
git:
url: https://github.com/Tradewind-apps/flutter_contacts
ref: pb/fix-incompatible-java-version-target
carousel_slider:
pin_code_fields:
format:
flutter_localizations:
sdk: flutter
amplitude_flutter:
app_tracking_transparency:
gif:
flutter_dotenv:
flutter_speed_dial:
path:
appsflyer_sdk:
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^4.0.0
flutter_launcher_icons:
isar_generator:
version: *isar_version
hosted: https://pub.isar-community.dev/
build_runner: any
flutter_native_splash:
l10n_mapper_generator:
Please Help me i want to parse translation keys dynamically like context.parseL10n('signingUp') but i can't because its telling me
The method 'parseL10n' isn't defined for the type 'BuildContext'.
Try correcting the name to the name of an existing method, or defining a method named 'parseL10n'.dartundefined_method
Type: InvalidType
The text was updated successfully, but these errors were encountered: