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 the iOS Simulator.

During Xcode's build phase, we require a Run Script Phase that executes the embedded strip-framework.sh which removes slices for the Simulator.

If these slices are not removed, Apple will reject the binary. Xcode will emit a "iTunes Store Operation Failed: Unsupported Architectures. The executable YourApp contains unsupported architectures '[(x86_64, i386)]'." There might also be further errors "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 strip-framework.sh within Xcode, you can manually strip the framework to remove slices not required for the app:

Copy
1
2
3
4
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 using file:

1
file PSPDFKit.framework/PSPDFKit

Learn More

PSPDFKit phased out armv7s support with PSPDFKit 4 for iOS.

Learn about Bitcode and framework size.