-
Notifications
You must be signed in to change notification settings - Fork 105
Library not loaded: @rpath/libvlc.dylib #138
Comments
Unfortunately I don't have any device supported by BigSur, so can't debug this issue myself. Sorry. |
I found a few references that might help. This might have something to do with asar packaging (though I'm only running my project with electron-userland/electron-builder#5238 (comment) I'll try to pack the application with |
Building with
|
To get it working on MacOS you have to put libraries from VLC.app to right place in right format, and it can be tricky. |
I'm using the prebuilt libraries and putting them in Running Would you please explain "you have to put libraries from VLC.app to right place in right format"? Is there anything I can try and report back to you? |
If you already using prebuilt version - and it doesn't work, it's possible something was changed in libvlc or Electron, and it's possible I will have to look at it myself. |
I would really appreciate that, my app development really depends on this since the whole thing is not possible without WebChimera.js. I'm not on an M1 chip. I'm running it on a Macbook Air 2019. |
Ok, I'll try to find time to look at it on this week. |
Just to be sure, you was not able start your application with WebChimera.js embedded any single time, right? I mean your question not only about to pack Application for distributing, but about find way just run it, right? |
Correct. No matter what mode the app is being run in (development using The Windows prebuilt is running properly though. |
@ramtinsoltani I think I've found the reason. The problem is Electron tries load libraries from |
That fixed the problem for now. Great catch! Let me know if there's any help I can provide to fully fix this. |
@RSATom I have the same issue, but during development (not after building the app). It works fine on Windows, but not on Mac. So the issue seems to be related to this thread, but I am not sure how to apply the solution here during the development phase. I tried moving the files to the root of the package, but that didn't work either. Node version: v14.17.3 Any help here would be much appreciated. Thanks :) |
@aziztitu I've temporarily fixed this issue by copying all the webchimera files to Let me know if this helped. |
I just think it's bad idea copy any files to foreign dirs (i.e. not owned by WebChimera.js) automatically. On other side, I don't know how to force Electron load .dylibs from specific dir. So all we can do - create some "post install" script which developer can run by hand. |
@ramtinsoltani That fixed it! Thank you so much!! Although, I do get a lot of errors in the console like so: I can live with that for now, and look into it more later if we don't have a solution right away. And @RSATom, yes, I agree. Or at least, I think we should add this fix as an entry in the Known issues and workarounds section |
@aziztitu good point |
EDIT >>> I found a workaround for this issue by writing an afterpack file that moves the vlc dependencies automatically within the packed libraries. I've managed to workaround this issue on local development env by pasting VLC and the *.dylib files into the electron frameworks folder as suggested, but couldn't do the same with the final build version. It seems like the files should be in Pasting them manually into the app bundle under this path seem to work, but that breaks my deployment and signing phases. Thanks |
Do something like this:
The following script will modify the paths so they are relative to the #!/bin/sh
# Show initial paths.
otool -L WebChimera.js.node
otool -L lib/libvlc.dylib
# Allows us to resolve libvlc relative to .node file.
install_name_tool -change @rpath/libvlc.dylib @loader_path/lib/libvlc.dylib WebChimera.js.node
# Allows us to resolve libvlccore relative to libvlc.
install_name_tool -change @rpath/libvlccore.dylib @loader_path/libvlccore.dylib lib/libvlc.dylib
# Confirm changes.
otool -L WebChimera.js.node
otool -L lib/libvlc.dylib
NOTE: The script inside |
I'm getting this error when using the prebuilt binaries on macos BigSur:
I'm importing the package (
index.js
) in Electron's main process.Using electron 11.3.0
Any ideas?
The text was updated successfully, but these errors were encountered: