Closed Larpoux closed 3 months ago
no method named
async_runtime
Since IIRC your code is not for release yet, looks like you can (and need to) (temporarily) use master
version of frb, because that function is newly exposed.
To use master version or a local version of frb (maybe I should add a doc):
flutter_rust_bridge.yaml
set local: true
flutter_rust_bridge
dependencycargo run --manifest-path /path/to/your/flutter_rust_bridge/frb_codegen/Cargo.toml -- generate
instead of flutter_rust_bridge_codegen generate
I get a panic during generation. I certainly did something wrong but I cannot see what..
larpoux@Mac-mini:~/projmac/tau/tau_rust$ cargo run --manifest-path ../flutter_rust_bridge/frb_codegen/Cargo.toml -- generate
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.33s
Running `/Volumes/mac-J/larpoux/projmac/tau/flutter_rust_bridge/target/debug/flutter_rust_bridge_codegen generate`
[8.6s] Parse ⠐
└── [8.5s] Cargo expand & syn parse ⠠ [2024-06-27T06:18:58.255Z ERROR frb_codegen/src/library/utils/logs.rs:55] panicked at /Volumes/mac-J/larpoux/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-2.0.28/src/lit.rs:1095:13:
Unrecognized literal: `(/*ERROR*/)`
thread 'main' panicked at /Volumes/mac-J/larpoux/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-2.0.28/src/lit.rs:1095:13:
Unrecognized literal: `(/*ERROR*/)`
[8.7s] Parse ⠂
└── [8.7s] Cargo expand & syn parse ⠁
The frb generation is OK now. But I get an error during Cargo build :
Compiling tau v0.1.0 (/Volumes/mac-J/larpoux/projmac/tau/tau_rust/rust)
warning: unused import: `trace::trace`
--> src/api/simple.rs:26:5
|
26 | use trace::trace;
| ^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `std::sync::Once`
--> src/api/simple.rs:33:5
|
33 | use std::sync::Once;
| ^^^^^^^^^^^^^^^
warning: unused import: `trace::trace`
--> src/api/toto.rs:26:5
|
26 | use trace::trace;
| ^^^^^^^^^^^^
warning: unused imports: `error as e`, `warn as w`
--> src/api/toto.rs:29:34
|
29 | use log::{info as i, trace as t, warn as w, error as e, debug as d};
| ^^^^^^^^^ ^^^^^^^^^^
warning: unused import: `trace::trace`
--> src/api/mimi.rs:26:5
|
26 | use trace::trace;
| ^^^^^^^^^^^^
warning: unused imports: `error as e`, `warn as w`
--> src/api/mimi.rs:29:34
|
29 | use log::{info as i, trace as t, warn as w, error as e, debug as d};
| ^^^^^^^^^ ^^^^^^^^^^
error[E0639]: cannot create non-exhaustive struct using struct expression
--> src/frb_generated.rs:34864:16
|
34864 | return web_audio_api::media_devices::MediaTrackConstraints {
| ________________^
34865 | | sample_rate: var_sampleRate,
34866 | | latency: var_latency,
34867 | | channel_count: var_channelCount,
34868 | | device_id: var_deviceId,
34869 | | };
| |_________^
For more information about this error, try `rustc --explain E0639`.
warning: `tau` (lib) generated 6 warnings
error: could not compile `tau` (lib) due to 1 previous error; 6 warnings emitted
Just copy the frb_example/integrate_third_party code, IIRC I workarounded this and added some comments about it
OK, it compiles now. Thanks
You are welcome!
I am a happy geek : Mozilla Audio Basics example runs perfectly. Now, I am going to port another Mozilla example.
The Audio graph :
The preview :
That looks great! 🎉
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.
Describe the bug
I got the file flutter_rust_bridge/frb_example/integrate_third_party/rust/src/api/override_web_audio_api.rs from the github repo. I get many errors during compilation of the rust code. I tried also to generate a newer flutter_rust_bridge_codegen compiling the frb_codegen under your repo, but the result was not better.
Steps to reproduce
Logs
Expected behavior
No response
Generated binding code
No response
OS
Macos
Version of
flutter_rust_bridge_codegen
flutter_rust_bridge_codegen 2.0.0
Flutter info
No response
Version of
clang++
No response
Additional context
No response