sentry-react-native icon indicating copy to clipboard operation
sentry-react-native copied to clipboard

iOS Build Failure on EAS: Pods.xcodeproj Corrupted with `_setSavedArchiveVersion` Error

Open 70nyIT opened this issue 2 months ago • 12 comments

What React Native libraries do you use?

Expo Application Services (EAS)

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

7.4.0

How does your development environment look like?

- @sentry/react-native: 7.4.0
- Expo SDK: 54.0.13
- React Native: 0.81.4
- EAS Build: Latest
- Build Server Image: `macos-sequoia-15.6-xcode-26.0`
- Xcode: 26.0
- CocoaPods: 1.16.2
- Platform: iOS only (Android builds work fine)

Sentry.init()

Sentry.init({
    dsn: 'https://[vaule]@[value].ingest.de.sentry.io/[value]',

    // Use custom tunnel endpoint for log collection
    tunnel: 'https://custom.example.com',

    release: '1.0.0', // this is dynamic - read from package.json

    // Set distribution to help differentiate between platforms
    dist: process.env.EXPO_PLATFORM || 'unknown',

    // Adds more context data to events (IP address, cookies, user, etc.)
    sendDefaultPii: true,

    // Enable Logs
    enableLogs: true,

    // Filter out errors before sending to Sentry
    beforeSend(event, hint) {
      const error = hint.originalException;
      { ... } // custom filters
      return event;
    },

    // Configure Session Replay
    replaysSessionSampleRate: 0.1,
    replaysOnErrorSampleRate: 1,
    integrations: [Sentry.mobileReplayIntegration(), Sentry.feedbackIntegration()],
  });

Steps to Reproduce

  1. Create an Expo app with Expo SDK 54
  2. Install @sentry/react-native version 7.4.0
  3. Add Sentry initialization in app code (with or without the Expo plugin in app.config.ts)
  4. Run eas build --platform ios on EAS Build
  5. Build fails with the error above during CocoaPods phase

Expected Result

Builds with no errors

Actual Result

iOS builds fail on EAS Build with a corrupted Pods.xcodeproj file. The error occurs during xcodebuild -resolvePackageDependencies before the build even starts, making it impossible to compile the app.

Error Message

xcodebuild[4750:15583] -[PBXShellScriptBuildPhase _setSavedArchiveVersion:]: unrecognized selector sent to instance 0x6000031b4900

[MT] IDEFileReferenceDebug: [Load] <IDEFileReference, 0x12bf82a10: name:Pods path:group:Pods/Pods.xcodeproj> Failed to load container at path: /Users/expo/workingdir/build/ios/Pods/Pods.xcodeproj, Error: Error Domain=Xcode3ProjectErrorDomain Code=2 "The project 'Pods' is damaged and cannot be opened. Examine the project file for invalid edits or unresolved source control conflicts.
Path: /Users/expo/workingdir/build/ios/Pods/Pods.xcodeproj
Exception: -[PBXShellScriptBuildPhase _setSavedArchiveVersion:]: unrecognized selector sent to instance 0x6000031b4900"

What We've Tried

  • ✅ Removed Sentry Expo plugin from app.config.ts - still fails
  • ✅ Used --clear-cache flag - still fails
  • ✅ Configured disableAutoUpload: true in Sentry plugin - still fails
  • ✅ Deleted local ios/Pods folder - still fails on EAS

70nyIT avatar Oct 21 '25 15:10 70nyIT

RN-368

linear[bot] avatar Oct 21 '25 15:10 linear[bot]

Thank you for reporting @70nyIT 🙇 We will investigate this and iterate back.

I the meantime could you let us know if you are setting up Sentry on a new project or you noticed the issue after bumping to the latest (7.4.0) version?

antonis avatar Oct 22 '25 10:10 antonis

hi @antonis . New project - installed using your wizard and it installed directly the 7.4.0

70nyIT avatar Oct 22 '25 15:10 70nyIT

Thank you for the prompt response @70nyIT 🙇 We will investigate this and iterate back.

antonis avatar Oct 22 '25 15:10 antonis

Is there any update or workaround you recommend to set in place?

70nyIT avatar Nov 04 '25 15:11 70nyIT

from @alwx:

@70nyIT I will try my best to come with an update within the next few hours.

linear[bot] avatar Nov 05 '25 14:11 linear[bot]

@70nyIT hello again and thanks for your patience. I believe this issue got fixed once we bumped core to 0.80 — please, give it a try with the latest (7.50) version of @sentry/react-native which was released a few days ago: https://github.com/getsentry/sentry-react-native/releases/tag/7.5.0

I've just tried it with EAS and got the application built without any serious issues. The only minor thing you have to do though is it create a ~/.sentryclirc file which should contain your Sentry auth token, otherwise you'll get an authorization issue when bundling your package. Here you can find details on how to do that: https://docs.sentry.io/cli/configuration/#to-authenticate-manually

Here is how my build details look like:

Image

I used the empty RN project and installed Sentry using the wizard.

alwx avatar Nov 05 '25 18:11 alwx

@alwx unfortunately we're still experiencing the same issue with iOS builds on EAS after installing Sentry.

Environment:

  • @sentry/react-native: 7.5.0 (fresh installation, not an upgrade)
  • Expo SDK: 54.0.13
  • React Native: 0.81.4
  • New Architecture: Enabled (newArchEnabled: true)

Error: The build fails during xcodebuild -resolvePackageDependencies (before any actual compilation) with a corrupted Pods project:

▸ xcodebuild[4761:15682] -[PBXShellScriptBuildPhase _setSavedArchiveVersion:]: unrecognized selector sent to instance 0x600000228870

▸ [MT] IDEFileReferenceDebug: [Load] Failed to load container at path: /Users/expo/workingdir/build/ios/Pods/Pods.xcodeproj, 
  Error Domain=Xcode3ProjectErrorDomain Code=2 "The project 'Pods' is damaged and cannot be opened. 
  Examine the project file for invalid edits or unresolved source control conflicts."

▸ --- xcodebuild: WARNING: Unable to open project file '/Users/expo/workingdir/build/ios/Pods/Pods.xcodeproj' in workspace

This cascades into module import failures:

❌  (ios/AppDelegate.swift:1:8)
> 1 | import Expo
    |        ^ no such module 'Expo'

Why we believe it's Sentry-related:

  1. Timing: The error appeared immediately after adding the @sentry/react-native/expo plugin to our app config
  2. Error type: The error specifically mentions PBXShellScriptBuildPhase _setSavedArchiveVersion, and Sentry's Expo plugin is known to add shell script build phases to Xcode projects
  3. Android works fine: Same configuration builds successfully on Android, suggesting the issue is specific to how the plugin interacts with iOS/CocoaPods/Xcode
  4. Error occurs during prebuild: The corruption happens during xcodebuild -resolvePackageDependencies, before any build scripts or authentication attempts run

What we've tried: ✅ Added SENTRY_AUTH_TOKEN to EAS build secrets - same error ✅ Created ~/.sentryclirc file via EAS build hook - same error ✅ Added disableAutoUpload: true to plugin config - same error ✅ Used --clear-cache flag - same error

Current plugin configuration:

[
  "@sentry/react-native/expo",
  {
    organization: "our-org",
    project: "our-project",
    disableAutoUpload: true
  }
]

The issue appears to be a fundamental incompatibility with how the plugin modifies the Xcode project structure during the Expo prebuild phase, rather than an authentication or configuration issue. Any guidance would be greatly appreciated!

70nyIT avatar Nov 10 '25 14:11 70nyIT

Thank you for iterating on this @70nyIT 🙇 We will investigate it and iterate back.

antonis avatar Nov 11 '25 15:11 antonis

@70nyIT it's hard to say what could be the reason by the information you gave but I would suggest trying to update dependencies.

To make your life a bit easier I pubished my test project here: https://github.com/alwx-sentry/test-eas-app You could take a look at it and see how similar it is to yours — please, pay extra attention to the dependencies and to the metro configuration (metro.config.js). In order to make this project build on EAS you'd also need to do a few small changes:

  1. add .sentryclirc with valid token (details: https://docs.sentry.io/cli/configuration/#to-authenticate-manually)
  2. set valid dsn in app/_layout.tsx (line 10)

Please, let me know if it works and if updating helped you.

alwx avatar Nov 13 '25 10:11 alwx

I think we have the same issue though I noticed it after installing a different package

When I bisected down I found that my builds succeed again once I uninstall expo-system-ui, which I notice is also included in your sample repo https://github.com/alwx-sentry/test-eas-app.

I'm thinking theres an incompatibility when both expo-system-ui and @sentry/react-native are installed?

(I haven't tested only removing sentry just yet, will try that next)

Edit: I bumped Sentry to latest (7.7.0) and don't see the issue now, the expo-doctor version of 7.2.0 was causing issues however

kieran-osgood avatar Nov 29 '25 10:11 kieran-osgood

@70nyIT could you let us know if any of the solutions of this issue helped you?

alwx avatar Dec 02 '25 14:12 alwx

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

getsantry[bot] avatar Dec 24 '25 08:12 getsantry[bot]