using Gstreamer.framework in a macOS XCode project causes runtime crash
Using Gstreamer.framework on the latest stable macOS build causes runtime crash with following logs when included in an Xcode project:
dyld[24137]: Library not loaded: @rpath/libgstreamer-1.0.0.dylib
Referenced from: <5DE67EF1-94D5-34F7-93C2-BC6CD69E311B> /Users/test/Library/Developer/Xcode/DerivedData/GST_TEST-ezzuxpyriuplfkcfxxgarshavpfl/Build/Products/Release/GST_TEST.app/Contents/MacOS/GST_TEST
Reason: tried: '/Users/test/Library/Developer/Xcode/DerivedData/GST_TEST-ezzuxpyriuplfkcfxxgarshavpfl/Build/Products/Release/libgstreamer-1.0.0.dylib' (no such file), '/usr/lib/system/introspection/libgstreamer-1.0.0.dylib' (no such file, not in dyld cache), '/Users/test/Library/Developer/Xcode/DerivedData/GST_TEST-ezzuxpyriuplfkcfxxgarshavpfl/Build/Products/Release/GST_TEST.app/Contents/Frameworks/libgstreamer-1.0.0.dylib' (no such file), '/Users/test/Library/Developer/Xcode/DerivedData/GST_TEST-ezzuxpyriuplfkcfxxgarshavpfl/Build/Products/Release/GST_TEST.app/Contents/Frameworks/libgstreamer-1.0.0.dylib' (no such file)
Steps to Reproduce
- Follow the gst-docs to create a new macOS project with XCode project
- Add
GStreamer.framework
to General → Frameworks and Libraries - Add the libraries path to Build Settings → Library Search Paths
- Add the headers path to Build Settings → System Header Search Paths
- Disable hardened runtime Build Settings → Enable Hardened Runtime.
- Run the project with the following code
#include <gst/gst.h>
void gst_test(void) {
gst_init(NULL, NULL);
}
This will cause runtime crash with the above logs
Build Environment
- Gstreamer 1.22.6
- macOS 14.2.1 (23C71)
- XCode Version 15.2 (15C500b)
- Architecture: arm64 (Apple Silicon)