Closed Holofox closed 6 months ago
It looks like after I changed the build.yaml in the project root the problem went away:
builders:
injectable_generator:injectable_builder:
enabled: true
generate_for:
- lib/**/repositories/**
- lib/**/services/**
- lib/**/interceptors/**
->
builders:
injectable_generator:injectable_builder:
enabled: true
generate_for:
- lib/**/*_repository.dart
- lib/**/*_service.dart
- lib/**/*_interceptor.dart
Hello! From time to time, a build randomly crashes in Gitlab CI/CD on a Linux machine due to "Invalid argument(s): Missing library". The project build either succeeds or fails.
I note that on a working machine with macOS such problems never arise. Could you tell me in which direction the problem should be investigated? Could this be a problem with the analyzer? https://github.com/dart-lang/sdk/issues/51142
Logs
``` $ dart run build_runner build --delete-conflicting-outputs [INFO] Generating build script... [INFO] Generating build script completed, took 754ms [INFO] Precompiling build script...... [INFO] Precompiling build script... completed, took 14.6s [INFO] Initializing inputs [INFO] Building new asset graph... [INFO] Building new asset graph completed, took 4.5s [INFO] Checking for unexpected pre-existing outputs.... [INFO] Checking for unexpected pre-existing outputs. completed, took 2ms [INFO] Running build... [INFO] Generating SDK summary... [INFO] 3.6s elapsed, 0/16 actions completed. [INFO] 6.4s elapsed, 0/16 actions completed. [INFO] 7.9s elapsed, 0/16 actions completed. [INFO] Generating SDK summary completed, took 7.9s [INFO] 9.0s elapsed, 5/55 actions completed. [INFO] 10.1s elapsed, 32/64 actions completed. [INFO] 11.3s elapsed, 41/68 actions completed. [INFO] 12.4s elapsed, 46/73 actions completed. [WARNING] json_serializable on lib/src/network/infra/models/device_meta.dart: Could not read the "pubspec.yaml` file associated with this package. Usage of package:json_annotation could not be verified. [INFO] 13.6s elapsed, 57/80 actions completed. [INFO] 14.7s elapsed, 72/95 actions completed. [INFO] 28.4s elapsed, 91/109 actions completed. [INFO] 29.4s elapsed, 113/137 actions completed. [INFO] 33.0s elapsed, 145/164 actions completed. [INFO] 34.0s elapsed, 176/192 actions completed. [INFO] 35.6s elapsed, 208/209 actions completed. [INFO] 36.6s elapsed, 228/244 actions completed. [INFO] 37.7s elapsed, 268/284 actions completed. [INFO] 38.7s elapsed, 273/289 actions completed. [INFO] 39.7s elapsed, 291/297 actions completed. [INFO] 40.8s elapsed, 296/297 actions completed. [INFO] 41.9s elapsed, 345/346 actions completed. [INFO] 42.9s elapsed, 565/575 actions completed. [INFO] 44.0s elapsed, 601/621 actions completed. [INFO] 45.5s elapsed, 604/625 actions completed. [INFO] 46.5s elapsed, 617/637 actions completed. [INFO] 47.5s elapsed, 664/688 actions completed. [INFO] 51.1s elapsed, 704/731 actions completed. [INFO] 54.2s elapsed, 714/736 actions completed. [INFO] 55.2s elapsed, 739/762 actions completed. [INFO] 59.9s elapsed, 775/777 actions completed. [SEVERE] injectable_generator:injectable_builder on lib/src/network/infra/services/black_list_service.dart: Invalid argument(s): Missing library: package:example/src/network/infra/example/chat/v2/blacklist_service.pbgrpc.dart Libraries: [{here all imports for project}] Root children: [dart:async, dart:collection, dart:convert, dart:core, dart:developer, dart:ffi, dart:html, dart:html_common, dart:indexed_db, dart:_http, dart:io, dart:isolate, dart:js, dart:_js, dart:js_interop, dart:js_interop_unsafe, dart:js_util, dart:math, dart:mirrors, dart:nativewrappers, dart:typed_data, dart:_native_typed_data, dart:cli, dart:svg, dart:web_audio, dart:web_gl, dart:_internal, dart:_js_helper, dart:_late_helper, dart:_rti, dart:_dart2js_runtime_metrics, dart:_interceptors, dart:_foreign_helper, dart:_js_names, dart:_js_primitives, dart:_js_embedded_names, dart:_js_shared_embedded_names, dart:_js_types, dart:_async_status_codes, dart:_recipe_syntax, dart:_load_library_priority, dart:_metadata, dart:_js_annotations, dart:_wasm, dart:ui, dart:ui_web, package:example/src/qr_code/infra/models/qr_scanner_page_tab.dart, package:example/src/network/infra/models/platform.dart, package:meta/meta_meta.dart, package:meta/meta.dart, ... (3305 total)] Readers: [dart:async, dart:collection, dart:convert, dart:core, dart:developer, dart:ffi, dart:html, dart:html_common, dart:indexed_db, dart:_http, dart:io, dart:isolate, dart:js, dart:_js, dart:js_interop, dart:js_interop_unsafe, dart:js_util, dart:math, dart:mirrors, dart:nativewrappers, dart:typed_data, dart:_native_typed_data, dart:cli, dart:svg, dart:web_audio, dart:web_gl, dart:_internal, dart:_js_helper, dart:_late_helper, dart:_rti, dart:_dart2js_runtime_metrics, dart:_interceptors, dart:_foreign_helper, dart:_js_names, dart:_js_primitives, dart:_js_embedded_names, dart:_js_shared_embedded_names, dart:_js_types, dart:_async_status_codes, dart:_recipe_syntax, dart:_load_library_priority, dart:_metadata, dart:_js_annotations, dart:_wasm, dart:ui, dart:ui_web, package:collection/collection.dart, package:equatable/equatable.dart, package:equatable/src/equatable.dart, package:equatable/src/equatable_config.dart, ... (1209 total)] Log: [load][targetLibrary: package:example/src/internal/infra/services/file_open_service.dart = /example/lib/src/internal/infra/services/file_open_service.dart] [load][targetLibrary: package:example/src/internal/infra/services/bridge_service.dart = /example/lib/src/internal/infra/services/bridge_service.dart] [load][targetLibrary: package:example/src/qr_code/use_cases/qr_code_result/qr_code_result_cubit.dart = /example/lib/src/qr_code/use_cases/qr_code_result/qr_code_result_cubit.dart] [load][targetLibrary: package:example/src/qr_code/use_cases/qr_code_scanner_controls/qr_code_scanner_controls_cubit.dart = /example/lib/src/qr_code/use_cases/qr_code_scanner_controls/qr_code_scanner_controls_cubit.dart] [load][targetLibrary: package:example/src/qr_code/use_cases/qr_code_scanner/qr_code_scanner_cubit.dart = /example/lib/src/qr_code/use_cases/qr_code_scanner/qr_code_scanner_cubit.dart] [removeLibraries][uriSet: {}][#0 LinkedElementFactory.removeLibraries (package:analyzer/src/summary2/linked_element_factory.dart:268:67) #1 LibraryContext.remove (package:analyzer/src/dart/analysis/library_context.dart:274:20) #2 AnalysisDriver._removePotentiallyAffectedLibraries (package:analyzer/src/dart/analysis/driver.dart:1952:22) #3 AnalysisDriver._applyPendingFileChanges (package:analyzer/src/dart/analysis/driver.dart:1468:7) #4 AnalysisDriverScheduler._run (package:analyzer/src/dart/analysis/driver.dart:2318:16)Flutter version: 3.19.3
injectable: 2.4.0 injectable_generator: 2.6.1 analyzer: 6.4.1