Closed AlaaEldeenYsr closed 1 year ago
@k-paxian any help
Any error message or quick reproduction project?
[INFO] Running build...
[INFO] 1.0s elapsed, 0/1 actions completed.
[INFO] 2.1s elapsed, 0/1 actions completed.
[INFO] 3.1s elapsed, 0/1 actions completed.
[INFO] 4.2s elapsed, 0/1 actions completed.
[INFO] 15.0s elapsed, 0/1 actions completed.
[WARNING] No actions completed for 15.1s, waiting on:
- dart_json_mapper on lib/main.dart
[SEVERE] dart_json_mapper on lib/main.dart:
AssetNotFoundException: ya_schools_parent_app|pubspec.yaml
[INFO] 16.2s elapsed, 33/49 actions completed.
[INFO] 17.2s elapsed, 65/81 actions completed.
[INFO] 18.2s elapsed, 96/111 actions completed.
[INFO] 19.2s elapsed, 129/144 actions completed.
[INFO] 20.3s elapsed, 167/182 actions completed.
[INFO] 21.5s elapsed, 200/215 actions completed.
[INFO] 22.5s elapsed, 286/287 actions completed.
[INFO] Running build completed, took 23.0s
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 167ms
[SEVERE] Failed after 23.2s
When i comment the flutter_translate_gen
configurations it works well, But when i add both configs of flutter_translate_gen
and dart_json_mapper
it throw the above error
targets:
$default:
builders:
dart_json_mapper:
generate_for:
# here should be listed entry point files having 'void main()' function
- lib/main.dart
# This part is needed to tell original reflectable builder to stay away
# it overrides default options for reflectable builder to an **empty** set of files
reflectable:
generate_for:
- no/files
# sources:
# include:
# - assets/i18n/**
# - lib/**
I created that quick reproduction project for you @k-paxian json_mapper_conflict.zip
Thanks 👍
Well that's a pure configuration issue here.
While using specific sources
configuration, which is by default **
here is the docs
So, while specifying a restricted list of sources you are reducing ability for dart_json_mapper
builder and other builders to discover entire package sources **
. Specifically dart_json_mapper
builder needs to have an access to the pubspec.yaml
of your package.
So to fix your case you just need to include pubspec.yaml
to the sources list:
targets:
$default:
sources:
include:
- assets/i18n/**
- lib/**
- $package$
- pubspec.yaml
Let me know if this helps
Thank you @k-paxian it worked well
I'm using a package for langs translations model generating, It requires to add that block of configurations in the
build.yaml
file https://github.com/Jesway/Flutter-Translate/wiki/3.-Generating-statically-typed-localization-keysThis, in turn, leads to a failure in dart_json_mapper