Closed bubnov closed 1 month ago
Hi! Thanks for opening your first issue here! :smile:
This sounds like something related to cargokit, the library that flutter_rust_bridge uses for compiling Rust in Flutter environment.
also, could you please show more logs flutter run -d macos --verbose
?
Hmm, then I guess I / flutter_rust_bridge cannot do much here, since this does sound like a cargokit-related question. I guess it would be great to check there.
I just checked cargokit
, and it turns out that this is an experimental tool with rather poor documentation (if it’s even appropriate to call the article "documentation" at all). But it’s better than nothing, I guess. As a result, the FRB is also experimental, which is unfortunate as I'm not sure it is production ready (taking into account that I can't even run the empty project on macos). I think It might be wise for me to stick to low-level tools like cbindgen
and ffigen
and write the necessary code myself. Thanks!
IMHO, cargokit is widely used, and looks usually stable. Not only is flutter_rust_bridge used by many places, but also cargokit-without-flutter_rust_bridge is used in e.g. https://pub.dev/packages/super_clipboard. Thus, I personally do not think cargokit is experimental. In addition, since cargokit is just a compile tool, even if it is unstable, it does not cause hard-to-debug runtime problems when flutter_rust_bridge uses it.
I tried to run the example of super_clipboard
on macos and got the same issue.
The final step that solved the issue was to uninstall/install the rust toolchain from the scratch:
rustup self uninstall
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
flutter clean && flutter pub get && flutter run -d macos
I have no idea why this helped tbh.
I think it would be helpful to mention this somewhere in the F.A.Q. or troubleshooting section in the docs.
The problem solved. Thanks!
Happy to see it works and you are welcome!
I think it would be helpful to mention this somewhere in the F.A.Q. or troubleshooting section in the docs.
Totally agree, and feel free to PR! I guess a place may be https://cjycode.com/flutter_rust_bridge/manual/troubleshooting (i.e. https://github.com/fzyzcjy/flutter_rust_bridge/blob/master/website/docs/manual/troubleshooting.md)
Sure, here is the PR: https://github.com/fzyzcjy/flutter_rust_bridge/pull/2350
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 try to create the demo app using the command from the docs:
When I try to run the app with command
flutter run -d macos
I get the error (check the full log bellow):The funny thing is that I have this target installed:
Rust toolchain:
rustup version:
Steps to reproduce
Just follow the command from the doc:
Logs
Expected behavior
No response
Generated binding code
No response
OS
macos
Version of
flutter_rust_bridge_codegen
2.5.0
Flutter info
Version of
clang++
No response
Additional context
No response