Hi.
I’m developing a Electron-based app. For pack into snap package I use electron-builder. All works fine.
But in last two releases I noticed that my snap package does not work. After run, the app crashes with next error:
/snap/figma-linux/x1/figma-linux: error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory
This error came after that I put libfreetype2.so into project, in root dir, to keep specific version of the library. It’s need for normal work of the app, where is version of the library is different.
Output of:
snap run --strace figma-linux 2>&1 | tail -50
open("/snap/figma-linux/x1/usr/lib/x86_64-linux-gnu/pulseaudio/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/snap/figma-linux/x1/usr/lib/x86_64-linux-gnu/mesa-egl/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/snap/figma-linux/x1/lib/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/snap/figma-linux/x1/usr/lib/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/snap/figma-linux/x1/lib/x86_64-linux-gnu/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("tls/x86_64/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("tls/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("x86_64/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/snap/figma-linux/x1/usr/lib/x86_64-linux-gnu/dri/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fd1bdab1000
open("/lib/x86_64-linux-gnu/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/tls/x86_64/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/tls/x86_64", 0x7fff53895280) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/tls/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/tls", 0x7fff53895280) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/x86_64/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu/x86_64", 0x7fff53895280) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64-linux-gnu", {st_mode=S_IFDIR|0755, st_size=4281, ...}) = 0
open("/usr/lib/x86_64-linux-gnu/tls/x86_64/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/tls/x86_64", 0x7fff53895280) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/tls/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/tls", 0x7fff53895280) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/x86_64/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu/x86_64", 0x7fff53895280) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64-linux-gnu", {st_mode=S_IFDIR|0755, st_size=2789, ...}) = 0
open("/lib/tls/x86_64/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/tls/x86_64", 0x7fff53895280) = -1 ENOENT (No such file or directory)
open("/lib/tls/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 EN
OENT (No such file or directory)
stat("/lib/tls", 0x7fff53895280) = -1 ENOENT (No such file or directory)
open("/lib/x86_64/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib/x86_64", 0x7fff53895280) = -1 ENOENT (No such file or directory)
open("/lib/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/lib", {st_mode=S_IFDIR|0755, st_size=406, ...}) = 0
open("/usr/lib/tls/x86_64/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls/x86_64", 0x7fff53895280) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/tls", 0x7fff53895280) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib/x86_64", 0x7fff53895280) = -1 ENOENT (No such file or directory)
open("/usr/lib/libpng16.so.16", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/usr/lib", {st_mode=S_IFDIR|0755, st_size=747, ...}) = 0
writev(2, [{iov_base="/snap/figma-linux/x1/figma-linux", iov_len=32}, {iov_base=": ", iov_len=2}, {iov_base="error while loading shared libra"..., iov_len=36}, {iov_base=": ", iov_len=2}, {iov_base="libpng16.so.16", iov_len=14}, {iov_base=": ", iov_len=2}, {iov_base="cannot open shared object file", iov_len=30}, {iov_base=": ", iov_len=2}, {iov_base="No such file or directory", iov_len=25}, {iov_base="\n", iov_len=1}], 10/snap/figma-linux/x1/figma-linux: error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory
) = 146
exit_group(127) = ?
+++ exited with 127 +++
error: exit status 127
The libpng lib exists in a system:
find /lib /usr -name "libpng16.so*"
/usr/lib/x86_64-linux-gnu/libpng16.so.16
/usr/lib/x86_64-linux-gnu/libpng16.so
/usr/lib/x86_64-linux-gnu/libpng16.so.16.36.0
/usr/lib/libpng16.so.16
/usr/lib/i386-linux-gnu/libpng16.so.16
/usr/lib/i386-linux-gnu/libpng16.so
/usr/lib/i386-linux-gnu/libpng16.so.16.36.0
Is the package cannot find the lib in system?
How to fix that?