Removing Architectures

PSPDFKit.framework and PSPDFKitUI.framework are distributed as fat frameworks for Carthage. These frameworks contain two architectures: arm64 and x86_64. The ARM architecture is for devices, while the x86_64 architecture is for the Simulator.

If these slices aren’t removed, Apple will reject the binary. Xcode will emit an error that says: “iTunes Store Operation Failed: Unsupported Architectures. The executable YourApp contains unsupported architectures ‘[(x86_64, i386)]’”. There might be additional 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

You can manually strip the framework to remove slices not required for the app:

Copy
1
2
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:

1
file PSPDFKit.framework/PSPDFKit

Learn More

PSPDFKit phased out armv7s support with PSPDFKit 4 for iOS.

Find out more about bitcode and framework size.