skip to Main Content

I am working on a mail client in flutter. I am using objectbox in my flutter app to store mails in cache, but when I built the app using command

flutter build linux --release

And created an executable, which runs fine on my device, but when ran on other devices, it gives the following error

./my_project: error while loading shared libraries: libobjectbox.so: cannot open shared object file: No such file or directory

I tried finding the file and it was n the bundle/lib directory, but still it shows no such file.

2

Answers


  1. Seems like your application called "my_project". To inspect the its system library dependencies, use the following commands:

    $ flutter build linux --release
    $ ldd build/linux/x64/release/bundle/my_project
    

    To wrap up this application for distribution, include everything in the bundle directory and verify the target linux system has all required sys libraries.

    You can use the following command:

    $ sudo apt-get install libgtk-3-0 libblkid1 liblzma5
    
    Login or Signup to reply.
  2. You can download a copy of the libobjectbox.so library using

    bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-dart/main/install.sh)
    

    Then ship the libobjectbox.so with your application executable in a lib folder. (Source: https://docs.objectbox.io/getting-started in Dart Native tab.)

    But it’s odd, I thought Flutter would bundle this as part of the executable. If you want, feel free to open an issue (https://github.com/objectbox/objectbox-dart/issues) to discuss/analyze this further.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search