-
Notifications
You must be signed in to change notification settings - Fork 294
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
Getting started with third party packages #2352
Comments
Hi, automatically scanning a whole third party package is experimental feature and may not support too complex arbitrary packages (since there are so many corner cases for Rust). Looks like nostr may contain some edge cases that does not support yet. But feel free to use the https://cjycode.com/flutter_rust_bridge/guides/third-party/manual manual way or to improve this experimental feature! |
Thanks to your last answer I've took the manual way I've created a simple function that consume the third party crate: use nostr::key::{Keys, SecretKey};
#[flutter_rust_bridge::frb(init)]
pub fn init_app() {
flutter_rust_bridge::setup_default_user_utils();
}
#[flutter_rust_bridge::frb(sync)]
pub fn generate_nostr_keys() -> (String, String) {
let keys = Keys::generate();
let secret = keys.secret_key().to_secret_hex();
let public = keys.public_key().to_string();
return (secret, public);
} While it's work fine on The following warnings were emitted during compilation:
warning: [email protected]: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
warning: [email protected]: 1 error generated.
warning: [email protected]: error: unable to create target: 'No available targets are compatible with triple "wasm32-unknown-unknown"'
warning: [email protected]: 1 error generated.
error: failed to run custom build command for `secp256k1-sys v0.10.1`
…
warning: build failed, waiting for other jobs to finish...
Error: Compiling your crate to WebAssembly failed
Caused by: Compiling your crate to WebAssembly failed
Caused by: failed to execute `cargo build`: exited with exit status: 101
full command: cd "rust" && "cargo" "build" "--lib" "--target" "wasm32-unknown-unknown" "-Z" "build-std=std,panic_abort" Is there a work-around ? |
I also had trouble building on |
Hi, that looks like a Rust compilation error. Thus maybe google / ask on the spcfici crate |
Is your feature request related to a problem? Please describe.
Hey there, I love to see it getting more and more mature. I would like to start to use it on some projects but I'm facing "getting started" problem. The one-liner to generate a flutter app with some rust functions is great but when it comes to third parties libraries I feel lost. I've read various sections of the documentation but it miss step by step approach so we can step in without many doubts
Describe the solution you'd like
Describe what you've tried
cd rust
cargo add nostr
cd ..
flutter_rust_bridge_codegen generate
error:
Additional context
I give here the example with the
nostr
third party package but I do not seek a specific answer for this, I'm looking for a more comprehensive way of using your tool his limits and how to work around.The text was updated successfully, but these errors were encountered: