Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build target hermes-engine: Command PhaseScriptExecution failed with a nonzero exit code #42221

Closed
yedi97 opened this issue Jan 10, 2024 · 12 comments

Comments

@yedi97
Copy link

yedi97 commented Jan 10, 2024

Description

I am facing the following problem after running my project again, the pod installed successfully without any problem, but when running using yarn run ios command, the error as below occurs, has anyone encountered this? like me? please help me. Yesterday I ran React Native version 0.73.1 and it still worked fine. Today, when I upgraded to 0.73.2, the following problem occurred. I also downgraded back to 0.73.1 but still no luck.

image

Steps to reproduce

  1. rm -rf node_modules && rm -rf yarn.lock && yarn install
  2. cd ios && rm -rf Pods/ && rm -rf Podfile.lock && pod install
  3. cd .. && yarn ios

React Native Version

0.73.2

Affected Platforms

Runtime - iOS, Build - MacOS

Output of npx react-native info

System:
  OS: macOS 14.2.1
  CPU: (8) arm64 Apple M1
  Memory: 476.27 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.8.1
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.21
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.1.0
    path: /opt/homebrew/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.13.0
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.2
      - iOS 17.2
      - macOS 14.2
      - tvOS 17.2
      - visionOS 1.0
      - watchOS 10.2
  Android SDK:
    Android NDK: 22.1.7171670
IDEs:
  Android Studio: 2023.1 AI-231.9392.1.2311.11255304
  Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 18.0.2
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: ^18.2.0
  react-native:
    installed: 0.73.2
    wanted: ^0.73.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: false
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

Build target hermes-engine of project Pods with configuration Release

warning: Run script build phase '[CP-User] [Hermes] Replace Hermes for the right configuration, if needed' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'hermes-engine' from project 'Pods')


Run script build phase '[CP-User] [Hermes] Replace Hermes for the right configuration, if needed' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase.

PhaseScriptExecution [CP-User]\ [Hermes]\ Replace\ Hermes\ for\ the\ right\ configuration,\ if\ needed /Library/Developer/Xcode/DerivedData/myProjectName-gzdlehmipieiindfjyfrhhcjupam/Build/Intermediates.noindex/ArchiveIntermediates/myProjectName/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/hermes-engine.build/Script-46EB2E0002C950.sh (in target 'hermes-engine' from project 'Pods')

Node found at: /var/folders/d5/f1gffcfx27ngwvmw8v8jdm7m0000gn/T/yarn--1704767526546-0.12516067745295967/node

/Library/Developer/Xcode/DerivedData/myProjectName-gzdlehmipieiindfjyfrhhcjupam/Build/Intermediates.noindex/ArchiveIntermediates/myProjectName/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/hermes-engine.build/Script-46EB2E0002C950.sh: line 9: /var/folders/d5/f1gffcfx27ngwvmw8v8jdm7m0000gn/T/yarn--1704767526546-0.12516067745295967/node: No such file or directory

Command PhaseScriptExecution failed with a nonzero exit code

Reproducer

https://github.com/yedi97/reproducer-react-native

Screenshots and Videos

image

@DAMHONGDUC
Copy link

DAMHONGDUC commented Jan 10, 2024

Screenshot 2024-01-10 at 10 51 35

same here

@yedi97
Copy link
Author

yedi97 commented Jan 10, 2024

Screenshot 2024-01-10 at 10 51 35 same here

haizz, it took me more than a day but I still can't fix it, even though I tried many ways

@yedi97
Copy link
Author

yedi97 commented Jan 10, 2024

I'm resolved from #36762 (comment), thanks all!

@GunnarAK
Copy link

This issue was fixed for me by deleting ios/.xcode.env.local. Then I ran pod install and installed the app successfully on my device.

Source: #36762 (comment)

@denka9999
Copy link

@GunnarAK thanks my friend!!! It worked for me

@sparkison
Copy link

This issue was fixed for me by deleting ios/.xcode.env.local. Then I ran pod install and installed the app successfully on my device.

Source: #36762 (comment)

Also working here for a recent project upgraded to RN 0.73.6 🎉

@patras1
Copy link

patras1 commented Apr 15, 2024

Hi,
I'm still facing the issue I tried the comment below it didn't work. ( in iOS )

I also tried to disable the herms by : :hermes_enabled => false.

Any suggestions?

This issue was fixed for me by deleting ios/.xcode.env.local. Then I ran pod install and installed the app successfully on my device.

Source: #36762 (comment)

@MarlonAEC
Copy link

That' didn't work for me, still struggling with this issue. Any clue how to solve it?

@OnurVar
Copy link

OnurVar commented Apr 19, 2024

It's already mentioned in Gemfile but please make sure you're using cocoapods version is lower 1.15

@tuanngocptn
Copy link

I just fixed with issue by linking the Node to /usr/local/bin/node.
First you need to find out the real Node PATH by

command -v node # in my machine that show => /Users/runner/hostedtoolcache/node/18.20.2/arm64/bin/node

Then Link that to /usr/local/bin/node.

ln -s /Users/runner/hostedtoolcache/node/18.20.2/arm64/bin/node /usr/local/bin/node

Or short cut with:

ln -s $(command -v node) /usr/local/bin/node

hope that will help you.

@usamaabutt
Copy link

This issue was fixed for me by deleting ios/.xcode.env.local. Then I ran pod install and installed the app successfully on my device.

Source: #36762 (comment)

Thanks this saved me to waste more time.

@DevNvll
Copy link

DevNvll commented May 17, 2024

I had this problem when changing the node version via nvm. I was just using nvm use lts/iron
It worked when I used nvm alias default lts/iron. I also deleted the .xcode.env.local file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests