Skip to content
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

Unreal Crashing when trying to run the MQTT plugin example on Mac OS #25

Open
AmirJavedMyWhoosh opened this issue Nov 1, 2022 · 2 comments

Comments

@AmirJavedMyWhoosh
Copy link

I am trying to run the MQTT example on the Mac os Ventura 13.0, with Unreal Engine v, 4.27.2.
The Editor is crashing as soon as I am clicking the connect button and there is an error with loading the library of mosqpp.

I have tried loading the library at runtime and compiling the source MQTT libraries but It didn't work, I am adding the screenshot of the function path where it's crashing.

Image link: https://user-images.githubusercontent.com/117156744/199192519-b51c360f-89ab-44d3-9096-41d9963ce43d.png
Crashing on: mosqpp::lib_init();

Also, let me know if there is any specific change that I need to do for this plugin to make it work with IOS and MAC.

@tustanivsky
Copy link
Member

Hey @AmirJavedMyWhoosh, currently the native MQTT libraries that this plugin is using under the hood have some compatibility issues with newer macOS versions.
On iOS everything should work fine though

@markusloffler
Copy link

markusloffler commented Nov 13, 2023

I was having the same problem on Apple Silicon. Following @tustanivsky's thought, I updated the mosquitto library to the latest version (2.0.18). However, I got the same crash. I finally figured out what the problem is: Unreal (I use 4.27.2) is using the x86_64 library of mosquitto (through Rosetta), located in Plugins/MqttUtilities/Source/ThirdParty/Mac/mosquittopp/libraries/mosquittopp.dylib. When initialising (mosqpp::lib_init), the library tries to load the depending libraries, libssl and libcrypto, which fails, leading to the crash. It fails to load libssl and libcrypto, because only the ARM version of those libraries were installed on my system.

These are my steps to fix it:

  • Install brew for x86/64 alongside with the native brew (https://stackoverflow.com/questions/64951024/how-can-i-run-two-isolated-installations-of-homebrew)
  • Using the x86/64 brew: brewx86 install mosquitto openssl@3 (assuming brewx86 is the alias to the x86/64 brew)
  • Find the mosquitto installation (brewx86 ls mosquitto)
  • Copy the header files to Plugins/MqttUtilities/Source/ThirdParty/Mac/mosquitto/includes (first, delete the old header files)
  • Copy the library libmosquitto.2.0.18.dylib to Plugins/MqttUtilities/Source/ThirdParty/Mac/mosquitto/libraries/mosquitto.dylib
  • Copy the library libmosquittopp.2.0.18.dylib and Plugins/MqttUtilities/Source/ThirdParty/Mac/mosquittopp/libraries/mosquittopp.dylib
  • Clean temporary files of the plugin (Plugins/MqttUtilities/Binaries, Plugins/MqttUtilities/Intermediate)
  • Open the Unreal project and let it rebuild the library

Note that it might not be necessary to update libmosquitto and just to install openssl (but then you need an older version of openssl, I think v1) - I didn't try that out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants