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

PhaseScriptExecution fails for Hermes Engine after install of react-native-reanimated #6333

Closed
mstohr1975 opened this issue Jul 26, 2024 · 17 comments
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@mstohr1975
Copy link

Description

I've reproduced an issue, whenever I install with npm install react-native-reanimated, then reinstall the pods with cd ios && pod install && cd .. and build the app with npx react-native run-ios I run into an error on Hermes Engine:

PhaseScriptExecution [CP-User]\ [Hermes]\ Replace\ Hermes\ for\ the\ right\ configuration,\ if\ needed /Users//Library/Developer/Xcode/DerivedData/

/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/hermes-engine.build/Script-46EB2E0001CA80.sh (in target 'hermes-engine' from project 'Pods')
(1 failure)

Same project before installing reanimated builds perfectly fine, I reproduced it a couple times. Any thoughts how to overcome this? Many thx

Steps to reproduce

  1. npm install react-native-reanimated
  2. cd ios && pod install && cd ..
  3. npx react-native run-ios

Snack or a link to a repository

happy to share later

Reanimated version

3.14.0

React Native version

0.73.6

Platforms

iOS

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Missing repro This issue need minimum repro scenario Platform: iOS This issue is specific to iOS labels Jul 26, 2024
@mstohr1975
Copy link
Author

Hi there,

I've reproduced a simple example under https://github.com/mstohr1975/ReanimateTest. In effect, it is set up with the latest Salesforce Mobile SDK React Native vanilla TypeScript project from https://developer.salesforce.com/docs/platform/mobile-sdk/guide/react-native-intro.html which is located here: https://github.com/forcedotcom/SalesforceMobileSDK-Templates/tree/dev/ReactNativeTypeScriptTemplate.

  1. So, I've created the project with forcereact create --platform=ios --appname=ReanimateTest --packagename=com.test.reanimate --organization="Reanimate Inc." --outputdir=
  2. Then I've started the project to validate it builds properly with npx react-native run-ios
  3. Afterwards I've installed the reanimate package: npm install react-native-reanimated
  4. Added the plugin in vi ./node_modules/react-native/template/babel.config.js at the end with plugins: ['react-native-reanimated/plugin']
  5. Reinstalled the pods with cd ios && pod install && cd ..
  6. And then after the rebuild with npx react-native run-ios I get the mentioned error.

The following build commands failed:
PhaseScriptExecution [CP-User]\ [Hermes]\ Replace\ Hermes\ for\ the\ right\ configuration,\ if\ needed /Users//Library/Developer/Xcode/DerivedData/ReanimateTest-cbxampfvgdijsheyaooblqxhwpyc/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/hermes-engine.build/Script-46EB2E0001C820.sh (in target 'hermes-engine' from project 'Pods')
(1 failure)

@github-actions github-actions bot added Repro provided A reproduction with a snippet of code, snack or repo is provided and removed Missing repro This issue need minimum repro scenario labels Jul 26, 2024
@mstohr1975
Copy link
Author

mstohr1975 commented Jul 26, 2024

Forgot one point, I've commented a post install in Podfile which generated another build error:

#React native post install
react_native_post_install(
installer,
$config[:reactNativePath],
:mac_catalyst_enabled => false
)

It will generate following error when installing Pods with pod install:

Downloading dependencies
Generating Pods project
Setting USE_HERMES build settings
Setting REACT_NATIVE build settings
[!] An error occurred while processing the post-install hook of the Podfile.

no implicit conversion of nil into String

/Users/mstohr/Documents/ReanimateTest/node_modules/react-native/scripts/cocoapods/utils.rb:129:in join' /Users/mstohr/Documents/ReanimateTest/node_modules/react-native/scripts/cocoapods/utils.rb:129:in block (2 levels) in set_node_modules_user_settings'
/Users/mstohr/Documents/ReanimateTest/node_modules/react-native/scripts/cocoapods/utils.rb:128:in each' /Users/mstohr/Documents/ReanimateTest/node_modules/react-native/scripts/cocoapods/utils.rb:128:in block in set_node_modules_user_settings'
/Users/mstohr/Documents/ReanimateTest/node_modules/react-native/scripts/cocoapods/utils.rb:127:in each' /Users/mstohr/Documents/ReanimateTest/node_modules/react-native/scripts/cocoapods/utils.rb:127:in set_node_modules_user_settings'
/Users/mstohr/Documents/ReanimateTest/node_modules/react-native/scripts/react_native_pods.rb:307:in react_native_post_install' /Users/mstohr/Documents/ReanimateTest/ios/Podfile:59:in block (2 levels) in from_ruby'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-core-1.15.2/lib/cocoapods-core/podfile.rb:196:in post_install!' /opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:1013:in run_podfile_post_install_hook'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:1001:in block in run_podfile_post_install_hooks' /opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:149:in message'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:1000:in run_podfile_post_install_hooks' /opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:337:in block (2 levels) in create_and_save_projects'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in write!' /opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:336:in block in create_and_save_projects'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/user_interface.rb:64:in section' /opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:315:in create_and_save_projects'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:307:in generate_pods_project' /opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:183:in integrate'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/installer.rb:170:in install!' /opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/command/install.rb:52:in run'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/claide-1.1.0/lib/claide/command.rb:334:in run' /opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/lib/cocoapods/command.rb:52:in run'
/opt/homebrew/lib/ruby/gems/3.3.0/gems/cocoapods-1.15.2/bin/pod:55:in <top (required)>' /usr/local/bin/pod:25:in load'
/usr/local/bin/pod:25:in `

'

@fredrifoUni
Copy link

This usually fixes it for me:

  1. rm ios/.xcode.env.local
  2. pod install

If that still doesn't work, clear the derived data and rebuild

@mstohr1975
Copy link
Author

Thx, will check next days and get back to you

@mstohr1975
Copy link
Author

mstohr1975 commented Aug 6, 2024

I tried it in different ways, but did not succeed.

First of all, I do not overcome the error when installing the pods given, I always have to comment following part in Podfile to prevent the error explained above. This only happens after I install the react-native-reanimated package

#React native post install
react_native_post_install(
installer,
$config[:reactNativePath],
:mac_catalyst_enabled => false
)

But more importantly, I've cleaned cache for all pods and rebuild as follows:

  1. cd ios
  2. pod cache clean --all
  3. pod install
  4. rm .xcode.env.local
  5. cd ...
  6. npx react-native run-ios

And still get the same error message:

The following build commands failed:
PhaseScriptExecution [CP-User]\ [Hermes]\ Replace\ Hermes\ for\ the\ right\ configuration,\ if\ needed /Users/mstohr/Library/Developer/Xcode/DerivedData/DautXpense-gfqjutltodrrgmftqbwaxdmozcdl/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/hermes-engine.build/Script-46EB2E0001CA80.sh (in target 'hermes-engine' from project 'Pods')
(1 failure)

See GitHub repository after removing .xcode.env.local: https://github.com/mstohr1975/ReanimateTest

@fredrifoUni
Copy link

@mstohr1975
Did you try to delete the derived data folder? If not, I'm not sure what could be causing it
Users/mstohr/Library/Developer/Xcode/DerivedData/

@mstohr1975
Copy link
Author

Ah, sorry, forgot to mention it...yes, I deleted the DerivedData folder. Same error...by the way, pod install will recreate the .xcode.env.local file...that's why I deleted it afterwards.

I also tried

rm -rf ~/Library/Developer/Xcode/DerivedData/
cd ios
pod deintegrate
pod update
cd..
npm start or npx react-native run-ios

Still the same error...

@mixnam
Copy link

mixnam commented Aug 11, 2024

What is the config in your ios/.xcode.env.local ?
Make sure that right path to node is specified in NODE_BINARY var. If it's not the right path to your actual node version, then just correct it manually. It worked for me

@mstohr1975
Copy link
Author

Many thanks. Let me check this coming week...I'll get back to you.

@mstohr1975
Copy link
Author

We validated the NODE_BINARY path directs to the latest node.js version: export NODE_BINARY=/usr/local/bin/node. That seems not the issue either. Thx for your help anyways.

@piaskowyk
Copy link
Member

Hey, it appears that this issue is not Reanimated-related; rather, it seems to be a problem with the project configuration that is independent of Reanimated. You should define the environment variable REACT_NATIVE_PATH, and that should help resolve the issue.
image

@mstohr1975
Copy link
Author

Thx for your feedback, we'll test it.

@Neeraj-WebNeuron
Copy link

Neeraj-WebNeuron commented Oct 17, 2024

The following build commands failed:
PhaseScriptExecution [CP-User]\ [Hermes]\ Replace\ Hermes\ for\ the\ right\ configuration,\ if\ needed /Users/ios/build/Pods.build/Debug-iphoneos/hermes-engine.build/Script-46EB2E00021D90.sh (in target 'hermes-engine' from project 'Pods')
(1 failure)

Facing issue since a week now

@workflowdigital-george
Copy link

The following build commands failed: PhaseScriptExecution [CP-User]\ [Hermes]\ Replace\ Hermes\ for\ the\ right\ configuration,\ if\ needed /Users/ios/build/Pods.build/Debug-iphoneos/hermes-engine.build/Script-46EB2E00021D90.sh (in target 'hermes-engine' from project 'Pods') (1 failure)

Facing issue since a week now

Also facing the same issue. Did you manage to resolve this?

@mstohr1975
Copy link
Author

Yes, we did...as mentioned above. Let me know if this helps, otherwise we're happy to support.

@workflowdigital-george
Copy link

Yes, we did...as mentioned above. Let me know if this helps, otherwise we're happy to support.

I'm using expo eas to to do the building so I don't believe I can get access to the xcode.env.local file.

@ArkanRomanPango
Copy link

what helped me is:
which node it gives me next: /Users/roman/.nvm/versions/node/v18.17.0/bin/node

and then inside of .xcode.env I wrote next:
export NODE_BINARY=/Users/roman/.nvm/versions/node/v18.17.0/bin/node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided
Projects
None yet
Development

No branches or pull requests

7 participants