[iOS] Fix build fail when "ipconfig getifaddr" does not have IP #41823
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
One of the build phase scripts fails when IP is assigned to non-en0 interface because "ipconfig getifaddr en0" exits with 1 when IP is not assigned to en0. That produced "PhaseScriptExecution failed with a nonzero exit code" in Xcode. The patch fixes this issue by removing "set -e" and re-enabling it later in the script.
Summary:
iOS build fails during
Bundle React Native code and images
phase.The actual error message is
PhaseScriptExecution failed with a nonzero exit code
.After doing some debugging it appears the issue is within
scripts/react-native-xcode.sh
and was introduced in the commit a56e5daThe patch removes "set -e" and re-enables it after looping through interfaces. Also, added the original commit comment to explain why it's been added there initially.
Changelog:
[IOS][FIXED] Fix the build failure when "en0" does not have IP assigned
Test Plan: