Getting Started With Dynamic Libraries


With the release of Structure SDK (for iOS) 0.10.1 we are no longer shipping a static binary with our Structure.framework. While dynamic frameworks were not allowed prior to iOS 7.0, we’ve realized that any dependency or symbol collision we might have outside of our public API will cause problems as long as we ship with a static binary. So now, our framework is dynamically linked. To use it, please follow these steps:

1. Embed the framework into your app.
Go to your app’s target in Xcode, and then navigate to the “General” tab. From there you will be able to embed the framework by adding it to the “Embedded Libraries” section

2. Strip out the iphonesimulator targets.
Unfortunately, Apple is very strict about what architecture you can ship to the app store. Since our framework contains binaries for both iphoneos (arm64) and iphonesimulator (x86_64), you’ll need to strip out the iphonesimulator targets if you want to ship to the app store. Fortunately you can add a simple script to your build phases to make this work. Make a “run script” phase on your “Build Phases” tab, and add the following script (you can use /bin/sh as the shell):


# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)


for ARCH in $ARCHS

echo "Merging extracted architectures: ${ARCHS}"
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"

echo "Replacing original executable with thinned version"


This script is generic and so it should work without any dependencies or changes.

This is the solution that we will be using moving forward, so that some of our dependencies (Eigen3, OpenCV) don’t collide with dependencies that developers are using.

If you have any issues with the dynamic library update, please post your question here or email

Structure SDK (for iOS) 0.10.1: Updates for Apple Submission Compliance, Dynamic Libraries, and More

Need help with this, thanks.

After doing this:

I get this:


Hi OGuler,

Can you try clearing your derived data, and re-building?


This will happen if you have Structure.framwork in the “Embed Framworks” and not in the “Link Binary With Libraries”. It needs to be in both places.


Thanks @n6xej this resolved the issue. :fu:

For everyone else who struggle with this find the screenshots below from my “Build Phases”

Link Binary With Libraries

Embed Frameworks:


Hey any idea how to embed binaries in a Carthage file.??