Closed dannyhw closed 2 years ago
Turns out I needed to update a path in project.pbxproj
This is where I updated the script path
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../../../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../../../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
Addendum: I found this issue with very similar issues, and where the fix mentioned by @dannyhw worked for me. However, this was in an NX project, where my app folder was two levels deeper than expected.
The intent in that setup is that there is a symlink from node_modules
to ../../node_modules
. This symlink, in the NX content, is only created when the user starts the app for the first time.
It's probably better to make sure this symlink exists than to edit the pbxproj file.
@dannyhw - where in the file project.pbxproj did you make your change?
What was the original line?
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../../../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../../../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
I basically just search for node_modules in the pbxproj file and replace as needed
my issue is here:
Users/aaaaaa/Library/Developer/Xcode/DerivedData/aaaaa-hbrhrjckjsvkqxdphretyodpxreh/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/hermes-engine.build/Script-46EB2E0001D250.sh: line 2: /scripts/xcode/with-environment.sh: No such file or directory Command PhaseScriptExecution failed with a nonzero exit code
On Sun, May 12, 2024 at 10:48 AM Daniel Williams @.***> wrote:
I basically just search for node_modules in the pbxproj file and replace as needed
— Reply to this email directly, view it on GitHub https://github.com/react-native-community/upgrade-support/issues/214#issuecomment-2106325957, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABS6UT77O7ERPULNYZ7MVY3ZB6TO7AVCNFSM6AAAAAAQ5RUJCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWGMZDKOJVG4 . You are receiving this because you commented.Message ID: @.***>
/hermes-engine.build script is failing:
. "$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh"
is failing per above listing. $REACT_NATIVE_PATH is correctly set in the xcode project's user setting. but appears that the script isnt getting it.
my issue is here: Users/aaaaaa/Library/Developer/Xcode/DerivedData/aaaaa-hbrhrjckjsvkqxdphretyodpxreh/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/hermes-engine.build/Script-46EB2E0001D250.sh: line 2: /scripts/xcode/with-environment.sh: No such file or directory Command PhaseScriptExecution failed with a nonzero exit code … On Sun, May 12, 2024 at 10:48 AM Daniel Williams @.> wrote: I basically just search for node_modules in the pbxproj file and replace as needed — Reply to this email directly, view it on GitHub <#214 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABS6UT77O7ERPULNYZ7MVY3ZB6TO7AVCNFSM6AAAAAAQ5RUJCKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWGMZDKOJVG4 . You are receiving this because you commented.Message ID: @.>
Having same issue after upgrading to 0.73.0 React native version
Environment
Things I’ve done to figure out my issue
The method I used to upgrade was: I regenerated the project using the typescript template and then copied over the files and updated the paths to node_modules to match the mono-repo structure.
I built the project in xcode to investigate the cause of the issue and I found that the issue is
.xcode.env: command not found
Initially it seemed like the file was named incorrectly (_xcode.env) but even after changing it to .xcode.env it still isn't found.
The project doesn't have any native code other than pods included from some community packages.
Upgrading version
0.70.2
Description
When I run the project for android I have no issues, however when I build IOS I get error code 65 and when digging into the logs I find the following
.xcode.env: command not found
My project is in a mono-repo and the path to with-environment.sh works fine, however it seems like
ENV_PATH="$PODS_ROOT/../.xcode.env"
does not match with the path to the env file in my project.EDIT
seems like it does find .xcode.env but the command fails, if I put a static path to node in there then it gives me another error
../node_modules/react-native/scripts/xcode/with-environment.sh: No such file or directory
Still not sure why this is happening but this path does seem wrong since my node modules are at ../../../
Reproducible demo
The PR with the changes can be found here, https://github.com/storybookjs/react-native/pull/381
running the example project works as follows
I will try to provide a more bare bones reproduction, however it takes some time to setup a monorepo so I'll provide it here when it's ready. Hopefully the above PR can help clarify in the meantime.