Desdaemon / flutter_rust_bridge_template

Template for Flutter + Rust integration with flutter_rust_bridge.
https://desdaemon.github.io/flutter_rust_bridge_template/
Apache License 2.0
120 stars 63 forks source link

Justfile command failure #41

Closed nataliepopescu closed 1 year ago

nataliepopescu commented 1 year ago

Hiya, I'm trying to get codegen for the stock template working. I'm working on Linux (Ubuntu 22.04) and believe I've set up everything correctly according to the docs. Running just fails at the flutter_rust_bridge_codegen command with the following error:

error: --c-output's inputs should match --rust-input's length

The flutter_rust_bridge_codegen command in the justfile does indeed have two --c-output lines, and I've confirmed that removing either one of them resolves the error. But I imagine that both options are useful if I want to target both iOS and macOS simultaneously. Is there a simple fix for this?

Thanks!

Desdaemon commented 1 year ago

No problem, I was somewhat aware this would become an issue due to new features being implemented in the codegen. For now, you can delete one of the c-output lines and manually copy the other to the required location. I'll refresh the template again soon.

nataliepopescu commented 1 year ago

Sounds good, thank you!

nataliepopescu commented 1 year ago

Ah, seems like this can actually be fixed by using the -e / --extra-c-output-path flag like so:

... 
    --c-output macos/Runner/bridge_generated.h \
    --extra-c-output-path ios/Runner/ \
...

I've confirmed that this works on an iOS simulator running iOS 16.2, and can submit a patch for this if that's helpful.

Edit: this fix is also mentioned in another part of the docs