fzyzcjy / flutter_rust_bridge

Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple.

Home Page:https://fzyzcjy.github.io/flutter_rust_bridge/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

update version 2.0.0-dev.19 to 2.0.0-dev.28, this error has occurred when I run my rust unit test:flutter_rust_bridge::frb_generated_boilerplate!(); missing tokens in macro arguments

sdegongzuo opened this issue · comments

Describe the bug
update version 2.0.0-dev.19 to 2.0.0-dev.28, run command flutter_rust_bridge_codegen generate
this error has occurred when I run my rust unit test:

error: unexpected end of macro invocation
  --> src/frb_generated.rs:27:1
   |
27 | flutter_rust_bridge::frb_generated_boilerplate!();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing tokens in macro arguments
   |
note: while trying to match `default_stream_sink_codec`
  --> /Users/y/.cargo/registry/src/rsproxy.cn-0dccff568467c15b/flutter_rust_bridge-2.0.0-dev.28/src/for_generated/boilerplate.rs:7:9
   |
7  |         default_stream_sink_codec = $default_stream_sink_codec:ident,
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0425]: cannot find value `FLUTTER_RUST_BRIDGE_CODEGEN_VERSION` in this scope
  --> src/frb_generated.rs:31:1
   |
31 | flutter_rust_bridge::frb_generated_default_handler!();
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
   |
   = note: this error originates in the macro `flutter_rust_bridge::frb_generated_default_handler` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0405]: cannot find trait `CstDecode` in this scope
  --> src/frb_generated.rs:37:16
   |
37 |     path: impl CstDecode<String> + core::panic::UnwindSafe,
   |                ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `CstDecode` in this scope
  --> src/frb_generated.rs:57:18
   |
57 |     number: impl CstDecode<i32> + core::panic::UnwindSafe,
   |                  ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `CstDecode` in this scope
  --> src/frb_generated.rs:77:16
   |
77 |     name: impl CstDecode<String> + core::panic::UnwindSafe,
   |                ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `CstDecode` in this scope
  --> src/frb_generated.rs:98:6
   |
98 | impl CstDecode<bool> for bool {
   |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `CstDecode` in this scope
   --> src/frb_generated.rs:103:6
    |
103 | impl CstDecode<i32> for i32 {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `CstDecode` in this scope
   --> src/frb_generated.rs:108:6
    |
108 | impl CstDecode<u8> for u8 {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseDecode` in this scope
   --> src/frb_generated.rs:113:6
    |
113 | impl SseDecode for String {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseDecode` in this scope
   --> src/frb_generated.rs:120:6
    |
120 | impl SseDecode for bool {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseDecode` in this scope
   --> src/frb_generated.rs:126:6
    |
126 | impl SseDecode for i32 {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseDecode` in this scope
   --> src/frb_generated.rs:132:6
    |
132 | impl SseDecode for Vec<u8> {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseDecode` in this scope
   --> src/frb_generated.rs:143:6
    |
143 | impl SseDecode for u8 {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseDecode` in this scope
   --> src/frb_generated.rs:149:6
    |
149 | impl SseDecode for () {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseEncode` in this scope
   --> src/frb_generated.rs:155:6
    |
155 | impl SseEncode for String {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseEncode` in this scope
   --> src/frb_generated.rs:161:6
    |
161 | impl SseEncode for bool {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseEncode` in this scope
   --> src/frb_generated.rs:167:6
    |
167 | impl SseEncode for i32 {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseEncode` in this scope
   --> src/frb_generated.rs:173:6
    |
173 | impl SseEncode for Vec<u8> {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseEncode` in this scope
   --> src/frb_generated.rs:182:6
    |
182 | impl SseEncode for u8 {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `SseEncode` in this scope
   --> src/frb_generated.rs:188:6
    |
188 | impl SseEncode for () {
    |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `CstDecode` in this scope
  --> src/frb_generated.io.rs:13:6
   |
13 | impl CstDecode<String> for *mut wire_cst_list_prim_u_8 {
   |      ^^^^^^^^^ not found in this scope

error[E0405]: cannot find trait `CstDecode` in this scope
  --> src/frb_generated.io.rs:19:6
   |
19 | impl CstDecode<Vec<u8>> for *mut wire_cst_list_prim_u_8 {
   |      ^^^^^^^^^ not found in this scope

To Reproduce
Steps to reproduce the behavior:
update version 2.0.0-dev.19 to 2.0.0-dev.28, this error has occurred when I run my rust unit test

Expected behavior
A clear and concise description of what you expected to happen.
Run normally after upgrading the version

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • rust version: 1.76.0
  • OS: MacOS 14.3.1
  • Version 2.0.0-dev.28

Hi! Thanks for opening your first issue here! 😄

Hi, do you mean fzyzcjy/flutter_rust_bridge instead of fzyzcjy/flutter_smooth?

sorry, i mean flutter_rust_bridge

Hi, do you mean fzyzcjy/flutter_rust_bridge instead of fzyzcjy/flutter_smooth?

Hi! Thanks for opening your first issue here! 😄

Hi, could you please check whether your Cargo.toml shows correct flutter_rust_bridge version (or paste it here)?

[package]
name = "rust_lib"
version = "0.1.0"
edition = "2018"

[lib]
crate-type = ["cdylib", "staticlib"]

[dependencies]
flutter_rust_bridge = "=2.0.0-dev.28"

flutter_rust_bridge

this version is normal
[package]
name = "rust_lib"
version = "0.1.0"
edition = "2018"

[lib]
crate-type = ["cdylib", "staticlib"]

[dependencies]
flutter_rust_bridge = "=2.0.0-dev.19"

[dependencies]
flutter_rust_bridge = "=2.0.0-dev.19"

Looks like this is old. Could you please modify it to be .28 and see whether it works?

I faced the same issue after running my project in Windows, but after I updated flutter_rust_bridge_codegen to the latest version or the same version as in Cargo.toml, my project seems to be running perfectly.

cargo install 'flutter_rust_bridge_codegen@^2.0.0-dev.28'

I faced the same issue after running my project in Windows, but after I updated flutter_rust_bridge_codegen to the latest version or the same version as in Cargo.toml, my project seems to be running perfectly.

cargo install 'flutter_rust_bridge_codegen@^2.0.0-dev.28'

your flutter version?

your flutter version?

3.19.3

I have upgraded the versions of Flutter and flutter_rust_bridge_codegen to the latest version and they are running normally