Crash when using Steam on Mac

I want to use Steam in my project. It works on Windows, but on Mac the application crashes when trying to load Steam after I copy the sdk/redistributable_bin/osx32/libsteam_api.dylib from to /Users/Shared/UnrealEngine/4.14/Engine/Binaries/Mac/

TRAP_BRKPT at 0x7fff64b97075

Unknown() Address = 0x12b2db570 (filename not found) [in ???]
FOnlineSubsystemSteam::Init() Address = 0x12b243dad [/Users/build/Build/++UE4+Release-4.14+Compile/Sync/Engine/Plugins/Online/OnlineSubsystemSteam/Source/Private/OnlineSubsystemSteam.cpp, line 322] [in UE4Editor-OnlineSubsystemSteam.dylib]
FOnlineFactorySteam::CreateSubsystem(FName) Address = 0x12b281ed9 [/Users/build/Build/++UE4+Release-4.14+Compile/Sync/Engine/Plugins/Online/OnlineSubsystemSteam/Source/Private/OnlineSubsystemModuleSteam.cpp, line 47] [in UE4Editor-OnlineSubsystemSteam.dylib]
FOnlineSubsystemModule::GetOnlineSubsystem(FName) Address = 0x12b14d648 [/Users/build/Build/++UE4+Release-4.14+Compile/Sync/Engine/Plugins/Online/OnlineSubsystem/Source/Private/OnlineSubsystemModule.cpp, line 234] [in UE4Editor-OnlineSubsystem.dylib]
FOnlineSubsystemModule::LoadDefaultSubsystem() Address = 0x12b14bac7 [/Users/build/Build/++UE4+Release-4.14+Compile/Sync/Engine/Plugins/Online/OnlineSubsystem/Source/Private/OnlineSubsystemModule.cpp, line 91] [in UE4Editor-OnlineSubsystem.dylib]
FModuleManager::LoadModuleWithFailureReason(FName, EModuleLoadResult&, bool) Address = 0x10366225b [/Users/build/Build/++UE4+Release-4.14+Compile/Sync/Engine/Source/Runtime/Core/Private/Modules/ModuleManager.cpp, line 485] [in UE4Editor-Core.dylib]
FModuleDescriptor::LoadModulesForPhase(ELoadingPhase::Type, TArray<FModuleDescriptor, FDefaultAllocator> const&, TMap<FName, EModuleLoadResult, FDefaultSetAllocator, TDefaultMapKeyFuncs<FName, EModuleLoadResult, false> >&) Address = 0x10944d308 [/Users/build/Build/++UE4+Release-4.14+Compile/Sync/Engine/Source/Runtime/Projects/Private/ModuleDescriptor.cpp, line 410] [in UE4Editor-Projects.dylib]
FPluginManager::LoadModulesForEnabledPlugins(ELoadingPhase::Type) Address = 0x10945c7f7 [/Users/build/Build/++UE4+Release-4.14+Compile/Sync/Engine/Source/Runtime/Projects/Private/PluginManager.cpp, line 592] [in UE4Editor-Projects.dylib]
FEngineLoop::AppInit() Address = 0x1032a3815 (filename not found) [in UE4Editor]
FEngineLoop::PreInit(wchar_t const*) Address = 0x103289710 (filename not found) [in UE4Editor]
GuardedMain(wchar_t const*) Address = 0x10329d8a1 (filename not found) [in UE4Editor]
-[UE4AppDelegate runGameThread:] Address = 0x1032ab16c (filename not found) [in UE4Editor]
-[FCocoaGameThread main] Address = 0x1034c5526 [/Users/build/Build/++UE4+Release-4.14+Compile/Sync/Engine/Source/Runtime/Core/Private/Mac/CocoaThread.cpp, line 375] [in UE4Editor-Core.dylib]
__NSThread__start__ Address = 0x7fff8e93ae64 (filename not found) [in Foundation]
_pthread_body Address = 0x7fffa011799d (filename not found) [in libsystem_pthread.dylib]
_pthread_body Address = 0x7fffa011791a (filename not found) [in libsystem_pthread.dylib]
thread_start Address = 0x7fffa0115351 (filename not found) [in libsystem_pthread.dylib]

Hey dysplaced,

Could you run me through the steps you’ve taken to set up Steam on your end?
Did you add all of the proper information to your .ini file?

Yes, all the information is present. I doubt that it is a project issue: the same project works fine on Windows, and I have now tried the ShooterGame example with the same result: it crashes when running as standalone with the same error. It happens no matter whether Steam is actually running or not.

So the only step I’ve taken on the Mac to set up Steam is what I described above, I copied the libsteam_api.dylib

I have the same problem after copying the dylib file and running my application

Did you guys ensure to have the Online Subsystem Steam plugin enabled in Edit->Plugins?

I haven’t been able to reproduce the crash on my end at this time. If you add that information to your .ini, enable the plugin, and make the changes to include OSS if you’re using a C++ project as detailed in the above guide, it should work.

Would you guys mind providing your Mac specs? At least the OS version would be great.

The plugin is enabled. I’ve just tried again with 14.1, but the issue persists. I’m using El Capitan (10.11.6) on a ~1 year old MacBookPro 13 (2.7 GHz i5, 16 GB RAM, Iris 6100), let me know if more detailed specs would be useful.

Neither your replies nor the linked guide mention anything about having to copy a .dylib file. So just to be clear, is it expected that this step is necessary, and is the Steamworks SDK 132 from Steamworks the correct source for that file? I only gathered that I need to copy the file because of a log message if it is not present:

LogOnline:Display: STEAM: Loading Steam SDK 1.32 LogMac:Warning: dlopen failed: dlopen(/Users/Shared/UnrealEngine/4.14/Engine/Binaries/Mac/, 5): image not found LogOnline:Warning: STEAM: Steam SDK 1.32 libraries not present at or failed to load!

Sorry for the delay.

As far as I understand it, that file is only needed if you plan on using features such as achievements on Steam. What I’d like you to do for now is run through the basic setup process (i.e. adding the necessary information to your .ini file as detailed in the link I posted above and making sure the plugin is enabled). Try this in a clean project and let me know if you still experience the crash.

From there, we can figure out why you’re getting issues when you’re trying to copy over that file, and I’ll continue to test on my end.

Ok, I’ve created a new project, copied the .ini information and activated the steam plugin. Same result as before: when I don’t copy the file, the game starts but but I get the error message I posted above and Steam doesn’t work (I don’t see myself as playing Spacewar). When I copy the file, I get the same crash.

Are you adding the game on Steam as a non-steam game?

Try navigating to the Steam client, and in the bottom-left of the window you’ll see an + Add A Game button and click Add a Non Steam Game.

Then browse and find your .exe to run the game through steam and see if that makes a difference.

On mac, it’s important to run the game this way.

Hi Sean,

thanks for your continued support! I thought that starting the game through Steam is only necessary for the Steam overlay (as stated at Online Subsystem Steam | Unreal Engine Documentation).

I tried packaging the game and adding it as a Non Steam Game, with the same result as before: I did not have a Steam overlay, couldn’t see or host sessions, and still had the error message in the logs that the libsteam_api.dylib could not be found, however this time with a path inside the built .app.

After copying the dylib from the Steam SDK to the path inside the .app, however, I did not get a crash and could finally join and host sessions! The Steam overlay still doesn’t work but I can live with that for now.

I can create an answer from this and accept it, but I wonder whether this is really the correct (and only) way of getting Steam to work on OS X. In particular, it would be nice to be able to test Steam on Mac without always having to package the game, and to get rid of the manual file copy step.

I’m glad to hear that you’ve gotten it working for the most part now. As for the behavior you’re describing, it does sound strange. I’ll look into this soon and determine if there is a more efficient way to get this set up and if there is potentially even a bug that is interfering.