From 35965df9b716a062d56e00bf260c30824dbb77e3 Mon Sep 17 00:00:00 2001 From: Tom Owers Date: Thu, 30 Jul 2026 11:56:26 +0100 Subject: [PATCH] fix(mobile): build react-native-worklets from source on EAS iOS builds have been failing since the last green build in May, in two different ways that turn out to share one cause: Expo's precompiled RNWorklets XCFramework. 1. Cold builds could not archive: Pods/Headers/Private/RNReanimated/.../UIRuntimeDecorator.h:6:10 'worklets/Compat/StableApi.h' file not found ** ARCHIVE FAILED ** RNReanimated compiles from source, but RNWorklets was consumed as a precompiled XCFramework whose headers are only put in place by the "[Expo] Switch RNWorklets XCFramework for build configuration" script phase. That phase is not an input dependency of RNReanimated's compile, so the two race and reanimated loses. Warm builds hid it by restoring a Pods cache that already had the headers, so any change to the native fingerprint failed while an unchanged rebuild passed. 2. Builds that did archive could not be exported: IDEDistributionMethodManagerErrorDomain Code=2 "Unknown Distribution Error" error: exportArchive exportOptionsPlist error for key "method" expected one {} but found app-store Xcode could not enumerate any distribution method, so the allowed set was empty and every value was rejected -- ad-hoc and app-store alike. Opting RNWorklets out of prebuilt modules fixes both: the archive builds cleanly and exports to a signed .ipa. EAS sets EXPO_USE_PRECOMPILED_MODULES=1 itself, and which modules actually resolve to a prebuilt artifact varies per build (several 404 out of the artifact cache and silently fall back to source), which is why this looked intermittent rather than broken. --- apps/mobile/package.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 5ba07d954b..7e1fe582b6 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -24,6 +24,11 @@ "clean": "node ../../scripts/rimraf.mjs .turbo .expo" }, "expo": { + "autolinking": { + "buildFromSource": [ + "react-native-worklets" + ] + }, "doctor": { "reactNativeDirectoryCheck": { "exclude": [