facebook / facebook/facebook-ios-sdk

18.1.x dynamic XCFrameworks (arm64 + arm64e) fail to load on iOS 17/18 after App Store update: "could not register fairplay decryption, mremap_encrypted() => -1"

Open
#3,997 0 comments 0 reactions 0 assignees View on GitHub
bug needs-triage
Dominant language
Swift
Stars
8.1k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

### Checklist before submitting a bug report

- [x] I've updated to the latest released version of the SDK
- [x] I've searched for existing [GitHub issues](https://github.com/facebook/facebook-ios-sdk/issues)
- [x] I've looked for existing answers on [Stack Overflow](https://facebook.stackoverflow.com), the [Facebook Developer Community Forum](https://developers.facebook.com/community/) and the [Facebook Developers Group](https://www.facebook.com/groups/fbdevelopers)
- [x] I've read the [Code of Conduct](https://github.com/facebook/facebook-ios-sdk/blob/main/CODE_OF_CONDUCT.md)
- [x] This issue is not security related and can safely be disclosed publicly on GitHub

### Xcode version

26.2 (17C52)

### Facebook iOS SDK version

18.1.1

### Dependency Manager

SPM

### SDK Framework

Core

### Goals

Update from facebook-ios-sdk 18.0.1 to 18.1.1 without breaking app launch for users on iOS versions below 26.

### Expected results

The app launches normally after the App Store update on every supported iOS version (our deployment target is iOS 16.0).

### Actual results

After shipping 18.1.1, users on iOS 17.6 – 18.7 (iPhone 12, iPhone 14 Pro, iPhone 16 observed) crash at launch before any app code runs. dyld cannot load FBSDKCoreKit:

Termination Reason: DYLD 1 Library missing
Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit
Referenced from: <2FC56459-...> /Volumes/VOLUME/*/heymoon.app/heymoon
Reason: tried: '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file, not in dyld cache),
'/private/preboot/Cryptexes/OS/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (no such file),
'/private/var/containers/Bundle/Application/.../heymoon.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit'
(could not register fairplay decryption, mremap_encrypted() => -1)

Because the process dies inside dyld, no crash reporter (Crashlytics/Sentry/Datadog) captures it; we found it via Xcode Organizer and .ips files from affected devices.

Conditions that we confirmed:
- Only when the app is installed via an App Store *update* from a version that shipped 18.0.1. Fresh installs, delete-and-reinstall, and TestFlight installs (including TestFlight updates) work fine with the exact same binary. Affected users are fixed by deleting and reinstalling.
- Only on iOS < 26. Users on iOS 26.x/27 load the same framework without problems.
- Nothing else about the Facebook integration changed between the two releases.

The difference between the two SDK versions is the architecture layout of the dynamic XCFrameworks:

18.0.1 FBSDKCoreKit.xcframework/ios-arm64 -> arm64
18.1.0 FBSDKCoreKit.xcframework/ios-arm64_arm64e -> arm64 arm64e
18.1.1 FBSDKCoreKit.xcframework/ios-arm64_arm64e -> arm64 arm64e

(same for FBSDKCoreKit_Basics and FBAEMKit; checked with `lipo -archs` on the release zips.)

So starting with 18.1.0 the embedded frameworks are fat arm64+arm64e binaries. When the App Store applies FairPlay encryption and delivers the update, dyld on iOS 17/18 fails to register decryption for these fat frameworks. This is the same failure mode other SDKs avoid by publishing arm64e builds as a separate variant (e.g. sentry-cocoa ships `Sentry-Dynamic` and `Sentry-Dynamic-WithARM64e` separately). Related: #2626 (arm64e build support request).

Workaround: pin facebook-ios-sdk back to 18.0.1. Stripping arm64e from the embedded frameworks in a build phase should also work.

Request: please ship the default dynamic XCFrameworks as arm64-only again and offer the arm64e slice as an opt-in variant, or document that 18.1.x requires stripping arm64e for apps that support iOS < 26.

### Steps to reproduce

1. App with deployment target iOS 16.0, facebook-ios-sdk 18.0.1 via SPM (FacebookCore), released on the App Store.
2. Update the dependency to 18.1.1, submit to the App Store, release.
3. On an iPhone running iOS 17.x or 18.x that already has the 18.0.1 build installed, update the app from the App Store and launch it.
4. The app terminates in dyld with the "could not register fairplay decryption" reason above.

Note: this does not reproduce via Xcode, TestFlight, or a fresh App Store install. It only reproduces through the App Store update path, so it is very hard to catch before release.

### Code samples & details

```swift
Package pin (Xcode project):
https://github.com/facebook/facebook-ios-sdk exactVersion 18.1.1 (products: FacebookCore)

Embedded framework layout from the 18.1.1 zips:
FBSDKCoreKit ios-arm64_arm64e minos 12.0 sdk 26.5 (DTXcode 2660)
FBSDKCoreKit_Basics ios-arm64_arm64e minos 12.0 sdk 26.5
FBAEMKit ios-arm64_arm64e minos 12.0 sdk 26.5

Affected devices/OS from crash reports:
iPhone13,2 (iPhone 12) iOS 17.6.1
iPhone15,2 (iPhone 14 Pro) iOS 17.6.1, 18.3.2
iPhone17,3 (iPhone 16) iOS 18.1.1, 18.3.2, 18.7.8
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.