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

[BUG]: Generator conflicts with localizely package #600

Open
2 tasks done
JSBmanD opened this issue Nov 13, 2024 · 3 comments
Open
2 tasks done

[BUG]: Generator conflicts with localizely package #600

JSBmanD opened this issue Nov 13, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@JSBmanD
Copy link

JSBmanD commented Nov 13, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Version

5.8.0

Command type

build_runner (Default)

What happened?

Everything works fine until I add https://pub.dev/packages/localizely_sdk
When I try to start build, it completes but with the error
[INFO] Checking for unexpected pre-existing outputs. completed, took 0ms
[SEVERE] localizely_sdk:localizely_builder on $package$:

UnexpectedOutputException: client_app|lib/src/core/localization/generated/intl/localizely_localizations.dart
Expected only: {client_app|.dart_tool/flutter_gen/gen_l10n/localizely_localizations.dart}

Removing generate: true doesn't help, intl not synthetic already

Relevant a pubspec.yaml.

name: client_app

# Prevent accidental publishing to pub.dev.
publish_to: 'none'

version: 99.99.99+99

environment:
  sdk: '>=3.0.5 <4.0.0'
  flutter: '>=3.24.0 <3.30.0'

dependencies:
  # Flutter SDK
  flutter:
    sdk: flutter
  collection: 1.18.0
  async: 2.11.0
  meta: 1.15.0

  # Localization
  intl: 0.19.0
  flutter_localizations:
    sdk: flutter

  drift: 2.21.0
  drift_db_viewer: 2.1.0
  sqlcipher_flutter_libs: 0.6.4
  sqlite3: 2.4.7
  go_router: 13.0.1
  json_annotation: 4.8.1
  localizely_sdk: 2.5.8

dev_dependencies:

  # Utils
  intl_utils: 2.8.7
  build_runner: 2.4.12
  drift_dev: 2.21.0
  go_router_builder: 2.7.1
  flutter_gen_runner: 5.8.0
  json_serializable: 6.7.1


flutter:
  uses-material-design: true
  generate: true

  assets:
    - assets/images/
 
flutter_gen:
  output: lib/src/core/assets/generated
  line_length: 80
  integrations:
    flutter_svg: true
    flare_flutter: false
    rive: false
    lottie: false

flutter_intl:
  enabled: true
  localizely:
    ota_enabled: false
  class_name: GeneratedLocalization
  main_locale: en
  arb_dir: lib/src/core/localization/translations
  output_dir: lib/src/core/localization/generated

Relevant log output

Building package executable... 
Built build_runner:build_runner.
[INFO] Generating build script completed, took 332ms
FlutterGen v5.6.0 Loading ... pubspec.yaml
[WARNING] Throwing away cached asset graph because the build phases have changed. This most commonly would happen as a result of adding a new dependency or updating your dependencies.
[WARNING] Throwing away cached asset graph because the language version of some package(s) changed. This would most commonly happen when updating dependencies or changing your min sdk constraint.
[INFO] Cleaning up outputs from previous builds. completed, took 165ms
[INFO] Generating build script completed, took 129ms
[WARNING] Invalidated precompiled build script due to missing asset graph.
[INFO] Precompiling build script... completed, took 9.5s
FlutterGen v5.8.0 Loading ...
Reading FlutterGen options from pubspec.yaml
[INFO] Building new asset graph completed, took 4.6s
[INFO] Checking for unexpected pre-existing outputs. completed, took 0ms
[SEVERE] localizely_sdk:localizely_builder on $package$:

UnexpectedOutputException: client_app|lib/src/core/localization/generated/intl/localizely_localizations.dart
Expected only: {client_app|.dart_tool/flutter_gen/gen_l10n/localizely_localizations.dart}
Generated: lib/src/core/assets/generated/assets.gen.dart
Generated: lib/src/core/assets/generated/fonts.gen.dart
FlutterGen finished.
[INFO] Running build completed, took 49.1s
[INFO] Caching finalized dependency graph completed, took 482ms
[SEVERE] Failed after 49.6s

Code of Conduct

  • I agree to follow this project's Code of Conduct
@JSBmanD JSBmanD added the bug Something isn't working label Nov 13, 2024
@AlexV525
Copy link
Member

You've set generated but the path is outside of .dart_tool which is possibly the reason. It does not seem to be related to the library.

@JSBmanD
Copy link
Author

JSBmanD commented Nov 14, 2024

@AlexV525 I was also using crowdin_sdk library that was generating everything in the same folder and nothing broke. But witg this, when I set up this as a synthetic in l10n, it conflicts with flutter_gen from the library. So I'm looking for some workaround how to use it as non-synthetic and generate things with flutter_gen.

@AlexV525
Copy link
Member

Could you minimize your example to determine which dependency directly conflicts with us? There are 10+ unrelated packages in your provided yaml IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants