I am having an issue with Xcode 15 when I create an archive build of my application. The general structure I something like:
Main Application:
- Links to staticLib.a
Plugins:
- use datatypes in staticLib.a
When I build an archive build and load the bundle for the plugin, I get the following type of errors:
Error Domain=NSCocoaErrorDomain Code=3588 "dlopen(pluginBinary, 0x0109): symbol not found in flat namespace '_OBJC_CLASS_$_FIRST_MISSING_CLASS'"
This program runs fine and finds the plugins without issues if I run the program from Xcode. It also will run and find the plugins correctly if I build a release build using xcodebuild. Only if I use Archive does it fail to load these files in the flat namespace. The plugins and the main binary say they use the TWOLEVEL namespace using otool -hV
on them.
If I link the static library to the plugin, I get undefined behavior because both are linking to the same binary. The plugins are using: -undefined dynamic_lookup
in their linker flags.
Any ideas how to resolve this?
Thanks, Steven