react-native: `pod install` command doesn't update hermes pod

Description

When you update React Native version and then do pod install or npx pod-install it won’t update Hermes

tested on react native: 0.70.8,0.71.6

React Native Version

0.71.6

Output of npx react-native info

System:
    OS: macOS 13.0.1
    CPU: (8) x64 Apple M1 Pro
    Memory: 33.12 MB / 16.00 GB
    Shell: 3.3.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 14.21.2 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 6.14.17 - /usr/local/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.12.0 - /Users/i/.rbenv/shims/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK:
      API Levels: 29, 30, 31, 32, 33
      Build Tools: 28.0.3, 29.0.2, 30.0.2, 30.0.3, 31.0.0, 33.0.0
      System Images: android-30 | Google Play ARM 64 v8a, android-30 | Google APIs ATD ARM 64 v8a, android-32 | Google APIs ARM 64 v8a, android-32 | Google Play ARM 64 v8a, android-33 | Google APIs ARM 64 v8a, android-33 | Google APIs Intel x86 Atom_64, android-33 | Google Play ARM 64 v8a
      Android NDK: Not Found
  IDEs:
    Android Studio: 2021.3 AI-213.7172.25.2113.9123335
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.11 - /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.5 => 0.71.5 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

npx react-native init testPodInstall
cd testPodInstall
bundle install
cd ios; bundle exec pod install; cd ..
# Change react-native version from "0.71.6" to "0.71.5" in package.json
yarn install
bundle exec pod install --project-directory ios
# or
npx pod-install

Result ios/Podfil.lock

  - hermes-engine (0.71.6): // <--- Ops... HAVE TO BE "0.71.5"
    - hermes-engine/Pre-built (= 0.71.6)
  - hermes-engine/Pre-built (0.71.6)

Snack, code example, screenshot, or link to a repository

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 3
  • Comments: 32 (16 by maintainers)

Commits related to this issue

Most upvoted comments

I think I found the problem. Here, we are defining that the hermes-engine pod must be installed using the specific podspec that is found at this path. However, it seems that with that option, Cocoapods is not able to determine whether the version changes.

Instead, by using :path, as the other local pods, and then doing pod install, it seems that the Podfile.lock properly shows the hermes versions:

Screenshot 2023-04-28 at 13 41 15

I’m setting up a PR to address this.

Came here to say the same. This is problematic in CI.

Updating from 0.71.6 to 0.71.7 here’s what we did:

yarn upgrade react-native@0.71.7 --exact
npx pod-install

…no mention of hermes-engine

Then in CI we have a couple steps before a Fastlane build:

    - cd ios
    - gem install bundler
    - bundle install
    - gem install cocoapods
    - pod install --repo-update

Yet this error occurs:


 CocoaPods could not find compatible versions for pod "hermes-engine":
  In snapshot (Podfile.lock):
    hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
  In Podfile:
    hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
It seems like you've changed the version of the dependency `hermes-engine` and it differs from the version stored in `Pods/Local Podspecs`.
You should run `pod update hermes-engine --no-repo-update` to apply changes made locally.

To resolve, we had to run pod update hermes-engine --no-repo-update locally and then push the Podfile.lock changes

The remedy so far would be to run pod update hermes-engine --no-repo-update and push the updated podfile.lock, or to add a step in CI that run pod update hermes-engine --no-repo-update if the previous pod install failed.

We are looking into backporting the fix also to 0.70 and 0.71 at least, but we don’t have a patch release scheduled yet for those versions, unfortunately.

This is a known issue that manifested earlier today because Cocoapods released version 1.15 which is breaking. Please refer to https://github.com/facebook/react-native/issues/42698 for updates. We are working on it.

The workaround for the time being is to downgrade to Cocoapods 1.14.

Are you encountering issues while working on the app?

So every upgrade we will need to run pod update hermes-engine --no-repo-update unless there is a new version of hermes-engine released? That seems clunky + should be documented properly if so, in my opinion.

So… you are encountering a problem! 😄

No, this should not happen! thank you for signalling this. I’ll put it in my queue and I hope to find a solution before the next release.

I experienced this from 0.71.8-> 0.72.5. The previously solution of pod update hermes-engine --no-repo-update worked for me.

Apologies if it came off as rude, I thought you meant more if it was affecting any other part of the development workflow. Thanks for looking into it 😃

There is a fix for 0.72, but we couldn’t backport it to 0.71, unfortunately. 😦

This is the fix: https://github.com/facebook/react-native/commit/8de71e58b6280d7a4957cc859e14268f6dde3bea

Hi, we also had the issue when updating from 0.71.6 to 0.71.7. Here are the logs from our last build in appcenter. No such issue with the builds with version 0.71.6

[command]/usr/local/lib/ruby/gems/3.0.0/bin/pod install --repo-update
Analyzing dependencies
Fetching podspec for `DoubleConversion` from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`
[Codegen] Found FBReactNativeSpec
Fetching podspec for `RCT-Folly` from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`
Fetching podspec for `boost` from `../node_modules/react-native/third-party-podspecs/boost.podspec`
Fetching podspec for `glog` from `../node_modules/react-native/third-party-podspecs/glog.podspec`
Fetching podspec for `hermes-engine` from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`
[!] CocoaPods could not find compatible versions for pod "hermes-engine":
  In snapshot (Podfile.lock):
    hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
  In Podfile:
    hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
It seems like you've changed the version of the dependency `hermes-engine` and it differs from the version stored in `Pods/Local Podspecs`.
You should run `pod update hermes-engine --no-repo-update` to apply changes made locally.
[error]The process '/usr/local/lib/ruby/gems/3.0.0/bin/pod' failed with exit code 1
[error]The 'pod' command failed with error: The process '/usr/local/lib/ruby/gems/3.0.0/bin/pod' failed with exit code 1

This feels like a bug that we want to investigate on. cc @cipolleschi

So every upgrade we will need to run pod update hermes-engine --no-repo-update unless there is a new version of hermes-engine released? That seems clunky + should be documented properly if so, in my opinion.

What do you guys usually do when updating a patch of an app?

I do yarn install then pod install that’s it.

P.S. npx react-native upgrade didn’t work for me, I manually apply required changes

Well, then it means that pod install is actually updating Hermes and that the Podfile.lock should be pushed to CI, no? Isn’t that expected that CI will fail if there is a file that is outdated? thinking

@cipolleschi when run pod install --project-directory ios or npx pod-install after RN version changing it’s updating all RN related pods except Hermes engine 😦

and when I do cd ios; pod install; on CI or locally it fail with the next error:

 CocoaPods could not find compatible versions for pod "hermes-engine":
  In snapshot (Podfile.lock):
    hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
  In Podfile:
    hermes-engine (from `../node_modules/react-native/sdks/hermes-engine/hermes-engine.podspec`)
It seems like you've changed the version of the dependency `hermes-engine` and it differs from the version stored in `Pods/Local Podspecs`.
You should run `pod update hermes-engine --no-repo-update` to apply changes made locally.

and when you check Podfile.lock

  - FBReactNativeSpec (0.71.6): // the same that I have in package.json !!!
  - hermes-engine (0.71.5) // <-- OLD VERSION  

Hi, I can confirm this issue when upgrading from 0.71.2 to 0.71.7. After upgrading with react-native upgrade, the build locally succeeds, with the Pod lockfile still showing hermes-engine 0.71.2. Building in CI pipeline without installed dependencies then fails. deleting Gemfile.lock and Podfile. lock as well as the pods and vendors folder, then running: bundle install -> bundle exec pod install updated the hermes pod to 0.71.7 in the lock file successfully.

Kind Regards

⚠️ Add or Reformat Version Info
ℹ️ We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.70.2