-
Trying to know, if is it possible that, we can use the 2.0.0-dev.22` when following steps mentioned in the, https://cjycode.com/flutter_rust_bridge/manual/integrate/existing Then it seems getting error... when running the command
there are error in the both, for e.g below in the file #[no_mangle]
pub extern "C" fn new_box_autoadd_aspect_ratio_0() -> *mut wire_AspectRatio {
support::new_leak_box_ptr(wire_AspectRatio::new_with_null_ptr())
} error: failed to resolve: use of undeclared crate or module `support`
label: use of undeclared crate or module `support`
failed to resolve: use of undeclared crate or module `support`
use of undeclared crate or module `support`rust As well also, error in
the error at, use crate::::*; #![allow(non_camel_case_types, unused, clippy::redundant_closure, clippy::useless_conversion, clippy::unit_arg, clippy::double_parens, non_snake_case, clippy::too_many_arguments)]
// AUTO GENERATED FILE, DO NOT EDIT.
// Generated by `flutter_rust_bridge`@ 1.82.6.
use crate::::*;
use flutter_rust_bridge::*;
use core::panic::UnwindSafe;
use std::sync::Arc;
use std::ffi::c_void;
use flutter_rust_bridge::rust2dart::IntoIntoDart;
// Section: imports
// Section: wire functions
// Section: wrapper structs
// Section: static checks
// Section: allocate functions
// Section: related functions
// Section: impl Wire2Api
pub trait Wire2Api<T> {
fn wire2api(self) -> T;
}
impl<T, S> Wire2Api<Option<T>> for *mut S
where
*mut S: Wire2Api<T>
{
fn wire2api(self) -> Option<T> {
(!self.is_null()).then(|| self.wire2api())
}
}
// Section: impl IntoDart
// Section: executor
support::lazy_static! {
pub static ref FLUTTER_RUST_BRIDGE_HANDLER: support::DefaultHandler = Default::default();
}
#[cfg(not(target_family = "wasm"))]
#[path = "bridge_generated.io.rs"] mod io;
#[cfg(not(target_family = "wasm"))]
pub use self::io::*; |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
below is overall log, when command flutter_rust_bridge_codegen --rust-input image_processing\src\api.rs --dart-output .\lib\bridge_generated.dart --dart-decl-output .\lib\bridge_definitions.dart PS C:\flutter-trails\rust_media_processing> flutter_rust_bridge_codegen --rust-input image_processing\src\api.rs --dart-output .\lib\bridge_generated.dart --dart-decl-output .\lib\bridge_definitions.dart
2024/02/02 18:36:27 [INFO] Running cargo expand in 'C:/flutter-trails/rust_media_processing/image_processing'
2024/02/02 18:36:34 [INFO] Phase: Validate config(s)
2024/02/02 18:36:34 [INFO] Picked config: Opts { rust_input_path: "C:\\flutter-trails\\rust_media_processing\\image_processing\\src\\api.rs", dart_output_path: "C:\\flutter-trails\\rust_media_processing\\.\\lib\\bridge_generated.dart", dart_decl_output_path: Some("C:\\flutter-trails\\rust_media_processing\\.\\lib\\bridge_definitions.dart"), c_output_path: ["C:\\Users\\harsh\\AppData\\Local\\Temp\\.tmp35fjUx.h"], rust_crate_dir: "C:\\flutter-trails\\rust_media_processing\\image_processing", rust_output_path: "C:\\flutter-trails\\rust_media_processing\\image_processing\\src\\bridge_generated.rs", class_name: "ImageProcessing", dart_format_line_length: 80, dart_enums_style: false, skip_add_mod_to_lib: false, llvm_path: ["/opt/homebrew/opt/llvm", "/usr/local/opt/llvm", "/usr/lib/llvm-9", "/usr/lib/llvm-10", "/usr/lib/llvm-11", "/usr/lib/llvm-12", "/usr/lib/llvm-13", "/usr/lib/llvm-14", "/usr/lib/", "/usr/lib64/", "C:/Program Files/llvm", "C:/msys64/mingw64"], llvm_compiler_opts: "", manifest_path: "C:\\flutter-trails\\rust_media_processing\\image_processing\\Cargo.toml", dart_root: Some("C:\\flutter-trails\\rust_media_processing"), build_runner: true, block_index: BlockIndex(0), skip_deps_check: false, wasm_enabled: false, inline_rust: false, bridge_in_method: true, extra_headers: "", dart3: true, keep_going: false }
2024/02/02 18:36:34 [INFO] Phase: Parse source code to AST, then to IR
2024/02/02 18:36:34 [INFO] Phase: Transform IR
2024/02/02 18:36:34 [INFO] Phase: Generate Rust code
2024/02/02 18:36:34 [INFO] Phase: Generate Dart code
2024/02/02 18:36:34 [INFO] Phase: Generating Dart bindings for Rust
the path is "C:\\Users\\harsh\\AppData\\Local\\Temp\\.tmp35fjUx.h"
2024/02/02 18:36:36 [INFO] Phase: Running build_runner
2024/02/02 18:36:36 [INFO] Running build_runner at C:\flutter-trails\rust_media_processing
2024/02/02 18:36:40 [WARN] command="powershell" "-noprofile" "-command" "& \"flutter\" \"pub\" \"run\" \"build_runner\" \"build\" \"--delete-conflicting-outputs\" \"--enable-experiment=class-modifiers\"" stdout=[INFO] Generating build script...
[INFO] Generating build script completed, took 334ms
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 105ms
[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 1.1s
[INFO] Running build...
[INFO] Running build completed, took 25ms
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 82ms
[SEVERE] freezed on lib/bridge_definitions.dart (cached):
This builder requires Dart inputs without syntax errors.
However, package:rust_media_processing/bridge_definitions.dart (or an existing part) contains the following errors.
bridge_definitions.dart:216:28: Methods must have an explicit list of parameters.
bridge_definitions.dart:216:59: A function body must be provided.
bridge_definitions.dart:216:59: Expected a class member.
And 1 more...
Try fixing the errors and re-running the build.
[SEVERE] Failed after 117ms
stderr=
2024/02/02 18:36:40 [ERROR] Fatal error encountered. Rerun with RUST_BACKTRACE=1 or RUST_BACKTRACE=full for more details.
Error: Failed to run build_runner for C:\flutter-trails\rust_media_processing: [INFO] Generating build script...
[INFO] Generating build script completed, took 334ms
[INFO] Initializing inputs
[INFO] Reading cached asset graph...
[INFO] Reading cached asset graph completed, took 105ms
[INFO] Checking for updates since last build...
[INFO] Checking for updates since last build completed, took 1.1s
[INFO] Running build...
[INFO] Running build completed, took 25ms
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 82ms
[SEVERE] freezed on lib/bridge_definitions.dart (cached):
This builder requires Dart inputs without syntax errors.
However, package:rust_media_processing/bridge_definitions.dart (or an existing part) contains the following errors.
bridge_definitions.dart:216:28: Methods must have an explicit list of parameters.
bridge_definitions.dart:216:59: A function body must be provided.
bridge_definitions.dart:216:59: Expected a class member.
And 1 more...
Try fixing the errors and re-running the build.
[SEVERE] Failed after 117ms
PS C:\flutter-trails\rust_media_processing> |
Beta Was this translation helpful? Give feedback.
-
Also, in the Wrapping up Section, https://cjycode.com/flutter_rust_bridge/manual/integrate/existing/finish Not sure what does below sentence means, sorry if incase missed anything, tried to follow up steps clearly,
|
Beta Was this translation helpful? Give feedback.
-
sorry, for pinging. It is bit urgency stuck here without it not able to make progress in project so deciding to ping you. Hope you don't mind, forgive let go this time... cc: |
Beta Was this translation helpful? Give feedback.
-
Hi, one of the quickest way may be to use |
Beta Was this translation helpful? Give feedback.
Hi, one of the quickest way may be to use
flutter_rust_bridge_codegen integrate
which auto add to your existing project in one command. Does that work for you?