question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

xCode: Error in Bundle React Native code and images

See original GitHub issue

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK version: 3.4.3

react-native version: 0.59.10

Are you using Expo?

  • Yes
  • No

I have following issue: Command PhaseScriptExecution failed with a nonzero exit code

Steps to reproduce:

  • I’ve upgraded @sentry/react-native from 3.2.13 to 3.4.3.
  • I executed build for xCode (iOS project), it throws a build error in Bundle React Native code and images phase script.

Actual result:

Error: spawn /***/node_modules/@sentry/cli/sentry-cli ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
    at onErrorNT (node:internal/child_process:477:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /***/node_modules/@sentry/cli/sentry-cli',
  path: '/***/node_modules/@sentry/cli/sentry-cli',
  spawnargs: [
    'react-native',
    'xcode',
    '../node_modules/react-native/scripts/react-native-xcode.sh'
  ]
}
Command PhaseScriptExecution failed with a nonzero exit code

Further Steps I noticed that sentry-cli binary is not in @sentry/cli/, it was in @sentry/cli/bin. So I changed /***/node_modules/@sentry/cli/js/helper.js code to refer the binary inside bin directly. Now, it does not throw build error, but it never complete this phase script, got stuck in there, no error prints etc.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
atokuswantocommented, Nov 10, 2022

Hi, @krystofwoldrich , thanks for your kind reply. I used default script provided by Sentry.

export SENTRY_PROPERTIES=sentry.properties
export EXTRA_PACKAGER_ARGS="--sourcemap-output $DERIVED_FILE_DIR/main.jsbundle.map"
export NODE_BINARY=node
../node_modules/@sentry/cli/bin/sentry-cli react-native xcode ../node_modules/react-native/scripts/react-native-xcode.sh
0reactions
krystofwoldrichcommented, Nov 11, 2022

Since the missing CLI binary was solved in the https://github.com/getsentry/sentry-cli/issues/1393 we can close this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ARCHIVE FAILED (PhaseScriptExecution Bundle\ React ...
This is not an issue. When building for simulator, React Native doesn't bundle the code. See https://github.com/facebook/react-native/blob/main ...
Read more >
XCode crashes when expanding the "Bundle React Native ...
The solution is as follows: Go to project. pbxproj , search for Bundle React Native codes and images , it should be the...
Read more >
Is there any of you facing issue with react native sentry error?
Running script 'Bundle React Native code and images' ** ARCHIVE FAILED **. The following build commands failed:
Read more >
RAM Bundles and Inline Requires - React Native
Before react-native can execute JS code, that code must be loaded into memory and parsed. With a standard bundle if you load a...
Read more >
Build Command Failed Using FastLan… - Apple Developer
Instead, I received this error: File/Users/myname/Library/Developer/Xcode/DerivedData/ ... PhaseScriptExecution Bundle\ React\ Native\ code\ and\ images ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found