LtbLightning / bdk-flutter

Bitcoin Development Kit - Flutter Package
MIT License
63 stars 28 forks source link

Not able to use library on windows #9

Open BitcoinZavior opened 2 years ago

BitcoinZavior commented 2 years ago

Unable to use library on windows development environment.

Error: dlopen failed: library "librust.io" not found

Screenshot 2022-09-01 at 22 53 04
thunderbiscuit commented 2 years ago

Related to bitcoindevkit/bdk-ffi#76 and bitcoindevkit/bdk-ffi#240.

aniketambore commented 1 year ago

I encountered a similar error today while trying to run my Flutter app on Android. The error message states:

Error: Invalid argument(s): Failed to load dynamic library 'librust_bdk_ffi.so': dlopen failed: library "librust_bdk_ffi.so" not found

The code triggering the error is as follows:

Future<String?> _generateMnemonic() async {
  print('[BDK API] Generating mnemonic...');
  try {
    final mnemonic = await Mnemonic.create(WordCount.Words12);
    return mnemonic.asString();
  } catch (e) {
    print('[BDK API] Error generation mnemonic: $e');
  }
  return null;
}

Environment:

Flutter Doctor Output

[√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [Version 10.0.22621.1702], locale en-IN)
    • Flutter version 3.10.5 on channel stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 796c8ef792 (3 weeks ago), 2023-06-13 15:51:02 -0700
    • Engine revision 45f6e00911
    • Dart version 3.0.5
    • DevTools version 2.23.1

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\aniket\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: D:\AndroidStudio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)
    • All Android licenses accepted.

[√] Android Studio (version 2022.2)
    • Android Studio at D:\AndroidStudio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-9586694)

[√] Connected device (3 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 12 (API 31) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.22621.1702]
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 114.0.1823.67

Would appreciate any guidance or assistance on resolving this issue. Thank you!