PSPDFKitUI.framework are distributed as fat frameworks for Carthage. These frameworks contain two architectures:
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.
Manually Stripping Architectures
You can manually strip the framework to remove slices not required for the app:
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
PSPDFKit phased out armv7s support with PSPDFKit 4 for iOS.
Find out more about bitcode and framework size.