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

Doesn't work on macOS #54

Open
pvt37 opened this issue Mar 14, 2022 · 2 comments
Open

Doesn't work on macOS #54

pvt37 opened this issue Mar 14, 2022 · 2 comments

Comments

@pvt37
Copy link

pvt37 commented Mar 14, 2022

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)

@k10dev
Copy link

k10dev commented Apr 20, 2022

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.

@radianceltd
Copy link

最后你们这个问题处理好了吗?我现在也出现你们一模一样的问题

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

3 participants