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
OSX .dylib loading issue with Electron/asar #123
Comments
@garlitzj Could you list your app directory? |
Hi, here is the general structure of the app directory as it pertains to Greenworks. It's virtually identical to the example in the readme: |-- lib Again, if I don't package the app as an asar, it loads properly. But once I package as an asar, it can no longer find the library files, and Greenworks fails to start. That's the strange part. There haven't been any such issues with Windows or Linux, so I'm not sure if it's something I'm missing. |
What's the specific error message? Have you read #102? it maybe helpful to resolve your issue. |
Few links for asar and his regular issues with node module : |
Hi, thanks for the responses. I'll research those links and try those later as soon as I can. The error I'm getting is the Library not loaded: @loader_path/libsteam_api.dylib issue, which I assume means Greenworks itself is being loaded. I know that's on the troubleshooting page, but the error only ever happens with asar turned on. With asar off, it loads without issue. As far as I can tell, the dylib files are in the correct place prior to the app being packaged, but something about the packaging is throwing off where it's trying to load them from? |
@garlitzj Sorry for the lonnnng delay. Sounds like a Greenworks issue. Could you provide a minimal sample which can reproduce the issue? It would help us a lot to track down the issue. |
@garlitzj Have you tried unpacking the entire lib folder via asar's I had to do this to get asar to work at all on Windows. I suspect other OSes may have a similar issue, especially if it's related to files alongside the (in my case I'm using |
Thanks for @Cleod9's reply. |
I'm also getting this issue when building my app for macOS for the first time.
It only happens after the app is already packaged up for production. In other words, when everything is in an Asar archive. Can we reopen the issue? For reference, my repository is Steps to reproduce:
|
This is the line that crashes: |
@Zamiell The error info you wrote "Reason: image not found'" doesn't look like it's from Greenworks. But assuming that line number in |
@Cleod9 Back when I started my Greenworks project, I couldn't even get the compiled releases to work at all, which is why I bothered to compile them myself in the first place. But yeah, I just tried out the compiled releases again. However, now I get this error (running from
No idea what is going on, but Any tips? |
@Zamiell So your app's root is the |
I still get the exact same error, so are you sure the issue is with it being in a subdirectory? |
@Zamiell Hmm, strange since i had a similar issue before I finally moved |
It's the exact same stack trace:
|
@Zamiell Ok thanks, I just wanted to confirm. I suspect that with your setup you should still place If that still doesn't work, try reverting to your original setup but running this instead and see what happens:
|
I kept the
I reverted to my original setup and did those commands, leading in an Windows error window popping up:
Any other ideas? Feel free to look at the layout of my repository, which doesn't seem very unusual, at least to me. |
But the principle is the same, I'm just bundling code with webpack first and spitting it out in the app directory to keep the source separated from the built app. For quick tests i usually run the app with the command i posted before while in the |
Hi, This is the structure:
Any help would be appreciated. |
On OSX, when I package my Electron app as an asar, Greenworks can't find the dylib files. However, without asar it works just fine. Moving the .dylib files to a default directory such as /usr/local/lib seems to solve the problem, but I was hoping to find a more elegant solution or some direction as to where the .dylib files would need to go in this context. I've tried including dylib files as extraResources, as extraFiles, and even moving them into the same folder as the .app to no avail. Any ideas? Thanks!
The text was updated successfully, but these errors were encountered: