Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid argument(s): Failed to load dynamic library (126) #7

Closed
indrawow opened this issue Dec 9, 2020 · 3 comments
Closed

Invalid argument(s): Failed to load dynamic library (126) #7

indrawow opened this issue Dec 9, 2020 · 3 comments

Comments

@indrawow
Copy link

indrawow commented Dec 9, 2020

Just install it, and run...
Getting this error,

Unhandled exception:
Invalid argument(s): Failed to load dynamic library (126)
#0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:13:55)
#1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
#2 LibraryLoader.load (package:dart_serial_port/src/dylib.dart:76:58)
#3 dylib (package:dart_serial_port/src/dylib.dart:31:66)
#4 _SerialPortImpl.availablePorts. (package:dart_serial_port/src/port.dart:230:21)
#5 Util.call (package:dart_serial_port/src/util.dart:36:13)
#6 _SerialPortImpl.availablePorts (package:dart_serial_port/src/port.dart:230:10)
#7 SerialPort.availablePorts (package:dart_serial_port/src/port.dart:82:61)
#8 main (file:///E:/Electron/dart_uhf/bin/main.dart:6:33)
#9 _startIsolate. (dart:isolate-patch/isolate_patch.dart:307:19)
#10 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)

Process finished with exit code 255

dart_serial_port: ^0.0.4+1

@jpnurmi
Copy link
Owner

jpnurmi commented Dec 9, 2020

dart_serial_port is based on FFI + libserialport, which must be deployed with the app. Pure Dart packages don't have a way to build C libraries, but it is possible to make use of Flutter's build system to do that. You can replace the dart_serial_port dependency in your pubspec.yaml with flutter_serial_port to automatically build and deploy libserialport.dll:

flutter_serial_port:
  git: https://github.com/jpnurmi/flutter_serial_port

More details: https://github.com/jpnurmi/flutter_serial_port

Hope this helps!

@jpnurmi
Copy link
Owner

jpnurmi commented Dec 9, 2020

Notice that dart_serial_port's wrapper https://github.com/jpnurmi/flutter_serial_port is not the same as the old deprecated https://pub.dev/packages/flutter_serial_port package on pub.

@indrawow
Copy link
Author

Thanks for comment 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants