flutter_rust_bridge icon indicating copy to clipboard operation
flutter_rust_bridge copied to clipboard

Hashes are the same but there is a hash mismatch shown

Open Xoroxa opened this issue 9 months ago • 6 comments

Describe the bug

Encountered the hash mismatch even when the hashes were the same. Made a new project and just added the cargo.toml dependencies and my single rust file, and the bug reappears.

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Bad state: Content hash on Dart side (496887197) is different from Rust side (-1918914929), 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)

Steps to reproduce

  1. create new flutter_rust_bridge project
  2. Add dependencies to cargo.toml to this: https://paaster.io/4EaNSzPdHXlO2WmC2Bdbi#qKfbjNKeUYLlcUuUJuKOcnhDwSOZZm-oh1GDycjQJc4
  3. Rust file: https://paaster.io/7uAfWZOxQH6ybuZMXdL4A#ET2ay2na9Y__u4i2tAzWxUtVSDDpiuS2akU4BrdZnQU
  4. Simply add these 2 to a new project and that is all it took for me to get the error.

Logs

https://paaster.io/1MJXUeidwwgpgmPARCEYv#6gzb9ckJCC0tNfj4fDASNmbBpreGDErcRpsB4pFviAE

Expected behavior

No response

Generated binding code

No response

OS

Windows

Version of flutter_rust_bridge_codegen

2.0.0-dev.34 & 2.0.0-dev.33

Flutter info

All checks

Version of clang++

Android (11695104, based on r522817) clang version 18.0.1

Additional context

No response

Xoroxa avatar May 19 '24 19:05 Xoroxa