forcedotcom/SalesforceMobileSDK-ReactNative

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

Closed this issue · 10 comments

Did anybody get react-native-reanimated package to work with Mobile SDK?

I get following error after installing the package into vanilla Mobile SDK project:

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')

Deleting .xcode.env.local, clearing cache or deleting DerivedData did not resolve. Thus I believe it is systemically to Mobile SDK setup. Anybody had this before?

Here my issue posted on reanimated project with more details: software-mansion/react-native-reanimated#6333

What version of Mobile SDK are you using?

Thx for your feedback, we're using 12.0.1

We just released Mobile SDK 12.1.0 which works with React Native 0.74.3. Do you mind giving it a try to see if the issue still exists?

Hi Wolfgang, many thx for the feedback. Let us test the new version and post an update then 👏

Wolfgang, we retried with 12.1.0. Same error. Any more ideas?

Interesting, is already the error see below during pod install which we had before with previous SDK version as well. We had to comment following lines in Podfile:

react_native_post_install(
installer,
$config[:reactNativePath],
:mac_catalyst_enabled => false
)

[!] An error occurred while processing the post-install hook of the Podfile.

no implicit conversion of nil into String

/Users/mstohr/Documents/dautXpense/node_modules/react-native/scripts/cocoapods/utils.rb:83:in join' /Users/mstohr/Documents/dautXpense/node_modules/react-native/scripts/cocoapods/utils.rb:83:in block (2 levels) in set_node_modules_user_settings'
/Users/mstohr/Documents/dautXpense/node_modules/react-native/scripts/cocoapods/utils.rb:82:in each' /Users/mstohr/Documents/dautXpense/node_modules/react-native/scripts/cocoapods/utils.rb:82:in block in set_node_modules_user_settings'
/Users/mstohr/Documents/dautXpense/node_modules/react-native/scripts/cocoapods/utils.rb:81:in each' /Users/mstohr/Documents/dautXpense/node_modules/react-native/scripts/cocoapods/utils.rb:81:in set_node_modules_user_settings'
/Users/mstohr/Documents/dautXpense/node_modules/react-native/scripts/react_native_pods.rb:293:in react_native_post_install' /Users/mstohr/Documents/dautXpense/ios/Podfile:51: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/update.rb:63: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 `

'

It seems we have to switch to native development, still too little projects on RN with SF Mobile SDK... damn

Hi Wolfgang, do you have more ideas or steps to validate. We don't get over this issue. Many thanks

We've resolved it by setting reactNativePath in post_install, defining reanimated not only in babel.config.js, but also in .babelrc and rebuilding after installation of reanimated in Xcode.

@mstohr1975 Can you guide how did you set the reactNativePath in post_install exactly ?
Screenshot 2024-10-08 at 11 51 15 PM
Because I'm getting this error after doing everything as you said.

@iamsurajnambiar sure...we just appended the following line in post_install of Podfile to fix it.

post_install do |installer|

  # Capture the $config value once again
  $config = use_native_modules!
...