Failed to generate *.freezed.dart for enum with fields (because `build_runner` is not added as a dependency)
CaviarChen opened this issue · comments
Describe the bug
codegen failed to generate *.freezed.dart files so enum with fields cannot be used.
Steps to reproduce
Simple repreduce: CaviarChen@d99b79c
Logs
code generator produce these two addtional log when having enum with fields:
[2024-01-23T15:32:11.380Z WARN ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.21/src/library/commands/command_runner.rs:133] command=cd "~/Documents/Workspace/flutter_rust_bridge/frb_example/flutter_via_create" && FRB_SIMPLE_BUILD_SKIP="1" "sh" "-c" "\"flutter\" \"pub\" \"run\" \"build_runner\" \"build\" \"--delete-conflicting-outputs\" \"--enable-experiment=class-modifiers\"" stdout= stderr=Could not find package "build_runner". Did you forget to add a dependency?
[2024-01-23T15:32:11.381Z WARN ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flutter_rust_bridge_codegen-2.0.0-dev.21/src/library/codegen/polisher/mod.rs:76] Fail to execute_build_runner, but continue to run.
Error details: Err(Failed to run build_runner for "~/Documents/Workspace/flutter_rust_bridge/frb_example/flutter_via_create": )
Flutter run:
Error (Xcode): lib/src/rust/api/simple.dart:9:6: Error: Error when reading 'lib/src/rust/api/simple.freezed.dart': No such file or directory
Expected behavior
No response
Generated binding code
No response
OS
No response
Version of flutter_rust_bridge_codegen
flutter_rust_bridge_codegen 2.0.0-dev.21
Flutter info
No response
Version of clang++
No response
Additional context
No response
Hi! Thanks for opening your first issue here! 😄
Could not find package "build_runner". Did you forget to add a dependency?
Hmm, it seems that the build_runner
needs to be as a flutter dev dependency
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 issue.