fzyzcjy / flutter_rust_bridge

Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple.
https://fzyzcjy.github.io/flutter_rust_bridge/
MIT License
4.3k stars 301 forks source link

Cannot mock RustLib without loading FFI #2247

Closed Tienisto closed 3 months ago

Tienisto commented 3 months ago

Describe the bug

Following the instructions in https://cjycode.com/flutter_rust_bridge/guides/how-to/test does not work.

I get the following error:

Invalid argument(s): Failed to load dynamic library 'rhttp.dll': error code 126
  dart:ffi                                                                new DynamicLibrary.open
  package:flutter_rust_bridge/src/platform_types/_io.dart 42:47           new ExternalLibrary.open
  package:flutter_rust_bridge/src/loader/_io.dart 62:46                   loadExternalLibraryRaw.<fn>
  package:flutter_rust_bridge/src/loader/_io.dart 49:22                   loadExternalLibraryRaw.tryAssumingNonPackaged
  package:flutter_rust_bridge/src/loader/_io.dart 61:12                   loadExternalLibraryRaw
  package:flutter_rust_bridge/src/loader/_io.dart 14:10                   loadExternalLibrary
  package:flutter_rust_bridge/src/main_components/entrypoint.dart 129:13  BaseEntrypoint._loadDefaultExternalLibrary
  package:flutter_rust_bridge/src/main_components/entrypoint.dart 48:31   BaseEntrypoint.initImpl
  package:rhttp/src/rust/frb_generated.dart 30:20                         RustLib.init

Steps to reproduce

Follow instructions in https://cjycode.com/flutter_rust_bridge/guides/how-to/test

Logs

Should not be needed

Expected behavior

No response

Generated binding code

No response

OS

Windows 11

Version of flutter_rust_bridge_codegen

2.1.0

Flutter info

No response

Version of clang++

No response

Additional context

No response

welcome[bot] commented 3 months ago

Hi! Thanks for opening your first issue here! :smile:

fzyzcjy commented 3 months ago

Good point and fix (#2248)!

github-actions[bot] commented 2 months ago

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.