Skip to content

Commit da0d173

Browse files
committed
Fix
1 parent 15de79e commit da0d173

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

dev-packages/e2e-tests/patch-scripts/rn.patch.podfile.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,22 @@ if (currentMatch) {
6363
debug.log('Warning: Could not find platform :ios line to patch');
6464
}
6565

66+
// Add Sentry source dependency to build from source for Xcode 26+ compatibility
67+
// The prebuilt XCFramework from CocoaPods was built with Xcode 16 and contains
68+
// Swift compatibility libraries that don't exist in Xcode 26
69+
// NOTE: Keep this version in sync with packages/core/RNSentry.podspec
70+
const sentryCocoaVersion = '9.4.1';
71+
const sentrySourceDep = ` # Build Sentry from source to support Xcode 26+\n pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '${sentryCocoaVersion}'\n`;
72+
const targetPattern = /(target\s+['"][^'"]+['"]\s+do\s*\n)/;
73+
let addedSentryDep = false;
74+
if (!content.includes("pod 'Sentry', :git =>")) {
75+
content = content.replace(targetPattern, `$1${sentrySourceDep}`);
76+
addedSentryDep = true;
77+
debug.log('Added Sentry source dependency for Xcode 26+ compatibility');
78+
}
79+
6680
// Write the file if any changes were made
67-
if (shouldPatch || currentMatch) {
81+
if (shouldPatch || currentMatch || addedSentryDep) {
6882
fs.writeFileSync(args['pod-file'], content);
6983
debug.log('Podfile patched successfully!');
7084
} else {

samples/react-native/ios/Podfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ target 'sentryreactnativesample' do
3636
:app_path => "#{Pod::Config.instance.installation_root}/.."
3737
)
3838

39+
# Build Sentry from source to support Xcode 26+
40+
# The prebuilt XCFramework from CocoaPods was built with Xcode 16 and contains
41+
# Swift compatibility libraries that don't exist in Xcode 26
42+
pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '9.4.1'
43+
3944
if ENV['RCT_NEW_ARCH_ENABLED'] == '1'
4045
pod 'AppTurboModules', :path => "./../tm"
4146
end

0 commit comments

Comments
 (0)