4.22 MacOS Packaged Build crashes, cannot find libfmodL.dylib

FMOD works great in the editor, but packaged builds crash immediately, unable to find the libfmodL.dylib file. The file definitely exists, and it seems to have the correct paths set up, using @rpath. Not sure what to do here exactly, any tips?

I’m on MacOS 10.14, XCode 9.4.1, FMOD 1.10.12.

Are you able to share the logs from the game?
You can send them to support@fmod.com.

Ok, just sent one over

This issue can be solved by running install_name_tool in the terminal to add the path “@executable_path/…/UE4/GameName/Plugins/FMODStudio/Binaries/Mac”

Thanks for the info, I am still looking into this issue.

It appears that in previous engine versions, our libs would get copied to the same folder as the executable but in UE4.22 they do not.

Sorry for the delay, it appears that this is an unwanted and unexpected side effect of some changes made to the Unreal Engine. They are looking for a fix for this but in the meantime modifications will need to be done in the engine:

https://udn.unrealengine.com/questions/500361/built-mac-game-unable-to-find-plugin-libs.html

Hi there @cameron-fmod , I can’t access the link :

In the meantime, can you add the solution here?
Thanks!

Hello @cameron-fmod
Could you give me a solution in order to be able to play to a package project please?

The solution requires access to the UE4 Source Engine, as you need to modify some engine code and then also recompile it (the Unreal Build Tool at least).

Thanks Cameron. Do you have an ETA for the fix on the side of Unreal?

Not at this point, they said they would let us know as soon as they figure out a proper fix.

Okay, so I made a big mistake as I worked on the 4.22 version before knowing there was a packaging bug with Fmod. I have to ship my project on the 5th of July and I can’t downgrade on UE 4.21 as the maps I worked on wont be able to work.
Would you mind to give me a few tips in order to build the engine from source? I already done this a few years ago for an android project so I’m not completely noobish, but actually I don’t understand the steps for @jeremyabel solution : “This issue can be solved by running install_name_tool in the terminal to add the path “@executable_path/…/UE4/GameName/Plugins/FMODStudio/Binaries/Mac””

Sorry :sweat:

Hey Tom! I’d be happy to help. Once the FMOD issue is sorted out, you’ll also encounter a great number of other issues packaging for mac desktop. I’ve created a script that fixes all the issues with a packaged build, and I’ll put that up on github later tonight. In the meantime, the exact command for fixing up the FMODStudio binaries is:

install_name_tool -add_rpath @executable_path/../UE4/YourGame/Plugins/FMODStudio/Binaries/Mac /Path/To/YourGame.app/Contents/MacOS/YourGame

You’ll need to fiddle with these paths in order to match them to your game. The first path (the one that starts with @executable_path), you just need to replace “YourGame” with whatever the name of your game project folder is. The second one is an absolute path to the packaged executable inside the app bundle. You can get this by right-clicking the app, and picking “Show Package Contents”. Then navigate to Contents/MacOS, and you’ll see an executable file with the name of your game. That’s the path you want to pass as the second argument to install_name_tool.

Running the install_name_tool command will only ensure the game runs correctly on your system. There’s about 10 other steps you’ll need to take in order for it to run correctly on other systems. I’ll reply to this thread with the script I wrote to automate all this.

I’m happy to help further, since packaging on desktop mac is currently undocumented. Shoot me an email at jeremyabel@gmail.com and I’d be happy to walk you through all of it.

2 Likes

Thank you so much @jeremyabel this is very kind from you!
I’ll wait for the script as I need to send a test version to my team mate.
Do I need to use/run the UE4 source Engine or does your solution work with the binaries?

It just works with the packaged game binaries. Here’s the script and all other required files, as well as some info in a README: https://github.com/jeremyabel/UnrealBuildMac

1 Like