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

Hash mismatch on linux with matching hashes

TaeHagen opened this issue · comments

Describe the bug

Bad state: Content hash on Dart side (-1867643805) is different from Rust side (1953154019), indicating out-of-sync code. This may happen when, for example, the Dart code is hot-restarted/hot-reloaded without recompiling Rust code. (Note: This is just a sanity check. Even if content hash does not change, the code may still change and needs to be recompiled)

However, the content hash in both the generated dart and rust source are the same -1867643805

Steps to reproduce

no clue why this happens

Logs

logs are too long for post

Expected behavior

No response

Generated binding code

No response

OS

No response

Version of flutter_rust_bridge_codegen

No response

Flutter info

No response

Version of clang++

No response

Additional context

Is the new rust library somehow not being used? I ran flutter clean, still same problem

Is the new rust library somehow not being used?

I suspect so. What about trying to delete the whole target directory in rust, which contains all compiled Rust files.

I did that, and now it works! I can't believe I didn't think of that 🤦. I suspect that would have resolved my other bug report that fixed itself upon wiping. You might want to document that as a troubleshooting step, or add it to the error message. Thank you!

(For potential future readers: The other issue is #1863)

You are welcome, and happy to see that this checker does catch the problem in #1863!

You might want to document that as a troubleshooting step, or add it to the error message.

Looks reasonable, and feel free to PR to change the https://github.com/fzyzcjy/flutter_rust_bridge/blob/master/website/docs/manual/troubleshooting.md :)