Skip to content

Failed to load dynamic library 'libserialport.so' #214

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

Closed
eximius313 opened this issue Jan 10, 2022 · 4 comments
Closed

Failed to load dynamic library 'libserialport.so' #214

eximius313 opened this issue Jan 10, 2022 · 4 comments

Comments

@eximius313
Copy link

eximius313 commented Jan 10, 2022

I'm trying to use flutter_libserialport library.
I've followed the guidelines of Libserialport and built the library.
I clearly have a file /usr/local/lib/libserialport.so
Unfortunately, when I run sudo flutter-pi my_apps_flutter_assets I see red screen with message:

Failed to load dynamic library 'libserialport.so': 'libserialport.so': cannot open shared object file: No such file or directory

How to force flutter-pi to see the libserialport.so

Kind regards,

@ardera
Copy link
Owner

ardera commented Jan 12, 2022

/usr/local/lib/ might not be in the default library search path.
try putting it in /usr/lib or launching flutter-pi with LD_LIBRARY_PATH=/usr/local/lib flutter-pi ...

@eximius313
Copy link
Author

Thanks!

# cd /usr/lib/
# ln -s /usr/local/lib/libserialport.so .

did the job!

@trapeye
Copy link

trapeye commented Feb 4, 2022

I don't have libdart_vlc_plugin.so at there folder, but when I create flutter build -d linux it create this libdart_vlc_plugin.so

do i need to copy paste, or just ln -s

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library '/usr/local/bin/lib/libdart_vlc_plugin.so': /usr/local/bin/lib/libdart_vlc_plugin.so: cannot open shared object file: No such file or directory

@ardera
Copy link
Owner

ardera commented Feb 4, 2022

@trapeye that's a different issue

dart_vlc will not work with flutter-pi without modification. You can't just copy the dart_vlcs plugin .so that was built for the linux desktop embedder, since linux desktop embedder and flutter-pi have different interfaces.

If you want to make dart_vlc working with flutter-pi you need to write some custom C code (in the flutter-pi source tree) to integrate it with flutter-pi's APIs

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