You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you tried to compile an run the example in the flutter_libserialport? If you run the example in this repo as indicated above, you would need to compile/provide the libserialport.dylib yourself.
The flutter_libserialport project uses the Flutter's build system to build and deploy the libserialport library for you.
I followed the steps in this guideline: https://pub.dev/packages/libserialport/install
and created an example like this: https://pub.dev/packages/libserialport/example
I tried to build & run on macOS but I got this error:
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libserialport.dylib': dlopen(libserialport.dylib, 0x0001): tried: '/Users/phantuong/Desktop/projects/flutter2/build/macos/Build/Products/Debug/flutter2.app/Contents/Frameworks/FlutterMacOS.framework/Versions/A/./libserialport.dylib' (no such file), '/Users/phantuong/Desktop/projects/flutter2/build/macos/Build/Products/Debug/flutter2.app/Contents/Frameworks/FlutterMacOS.framework/Versions/A/../../../libserialport.dylib' (no such file), '/usr/lib/swift/libserialport.dylib' (no such file), '/Users/phantuong/Desktop/projects/flutter2/build/macos/Build/Products/Debug/flutter2.app/Contents/MacOS/../Frameworks/libserialport.dylib' (no such file), 'libserialport.dylib' (no such file), '/usr/local/lib/libserialport.dylib' (no such file), '/usr/lib/libserialport.dylib' (no such file), '/Users/phantuong/Library/Containers/com.example.flutter2/Data/libserialport.dylib' (no such file), '/usr/local/lib/libserialport.dylib' (no such file), '/usr/lib/libserialport.dylib' (no such file)
#0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:12:43)
#1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:23:12)
#2 dylib
package:libserialport/src/dylib.dart:32
#3 _SerialPortImpl.availablePorts.
package:libserialport/src/port.dart:230
#4 Util.call
package:libserialport/src/util.dart:37
#5 _SerialPortImpl.availablePorts
package:libserialport/src/port.dart:230
#6 SerialPort.availablePorts
package:libserialport/src/port.dart:82
#7 main
package:flutter2/main.dart:7
#8 _runMainZoned.. (dart:ui/hooks.dart:130:25)
#9 _rootRun (dart:async/zone.dart:1426:13)
#10 _CustomZone.run (dart:async/zone.dart:1328:19)
#11 _runZoned (dart:async/zone.dart:1861:10)
#12 runZonedGuarded (dart:async/zone.dart:1849:12)
#13 _runMainZoned. (dart:ui/hooks.dart:126:5)
#14 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:297:19)
#15 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:192:12)
The text was updated successfully, but these errors were encountered: