Removing Architectures

The iOS SDKs (PSPDFKit.framework and PSPDFKitUI.framework) contain multiple architectures: i386, x86_64, armv7, and arm64. The arm architectures are for devices, while i386 and x86_64 are for Simulator.

During the XCode build phase, we require a Run Script Phase that executes the embedded, which then removes slices for Simulator.

If these slices are not removed, Apple will reject the binary. Xcode will emit an “iTunes Store Operation Failed: Unsupported Architectures. The executable YourApp contains unsupported architectures '[(x86_64, i386)]'” error. There might also be further errors, such as “LC_ENCRYPTION_INFO,” “Invalid Segment Alignment,” or “The binary is invalid.” Removing Simulator architectures resolves these issues.

Xcode Submit Application Issue Window

Manually Stripping Architectures

If you are unable to use within Xcode, you can manually strip the framework to remove slices not required for the app:

lipo -remove i386 -output PSPDFKit.framework/PSPDFKit PSPDFKit.framework/PSPDFKit
lipo -remove i386 -output PSPDFKitUI.framework/PSPDFKitUI PSPDFKitUI.framework/PSPDFKitUI
lipo -remove x86_64 -output PSPDFKit.framework/PSPDFKit PSPDFKit.framework/PSPDFKit
lipo -remove x86_64 -output PSPDFKitUI.framework/PSPDFKitUI PSPDFKitUI.framework/PSPDFKitUI

You can verify that the architectures are removed via file:

file PSPDFKit.framework/PSPDFKit

Learn More

PSPDFKit phased out armv7s support with PSPDFKit 4 for iOS.

Find out more about bitcode and framework size.