Skip to main content
Travis Wimer
Easily Fix Hermes Engine Library Missing Error

Easily Fix Hermes Engine Library Missing Error

Easily Fix Hermes Engine Library Missing Error

How to fix: CocoaPods could not find compatible versions for pod "hermes-engine"

Published / By Travis Wimer
Last updated

If you have recently tried creating a new React Native project or updating an existing one, you may have run into some errors using the Hermes engine on iOS:

Fetching podspec for `hermes-engine` from `../node_modules/react-native/sdks/hermes/hermes-engine.podspec`
[!] CocoaPods could not find compatible versions for pod "hermes-engine":

The reason you're seeing this is likely because each release of React Native now depends on specific versions of Ruby and CocoaPods.

Luckily the maintainers have also added a system to easily ensure you are using the correct versions:

1. Install the correct version of Ruby

To find the correct version of Ruby to use, navigate to the root directory of your project and open Gemfile.

In this file you will see a line that looks something like this:

ruby '2.7.5'

This is the Ruby version number that your project's version of React Native requires.

To install this version of Ruby, you have a few options. You can use any installation option in the Ruby Documentation, but it is recommended that you use rbenv or RVM. These are version managers that allow you to easily switch between different versions of Ruby, which will be helpful for React Native upgrades or working with multiple RN projects.

Once you have installed Ruby, make sure the correct version of Ruby is added to your PATH before continuing with the next steps. You can check this by running ruby --version and ensuring it matches the version in your Gemfile.

2. Upgrade CocoaPods

Now that you have the latest version of Ruby, you can easily upgrade CocoaPods by navigating to your project root and running the following command:

Shell
bundle install

This will automatically install the version of the CocoaPods gem listed in your Gemfile.

3. Update CocoaPod pods

First ensure CocoaPods has an up-to-date list of dependency releases by running the following command:

Shell
bundle exec pod repo update

Now install the pods by navigating to your ios directory and running this command:

Shell
bundle exec pod install

If this doesn't work, you may need to delete ios/Podfile.lock before and then rerun this command.

That's it!

Now your iOS build should correctly load Hermes without any errors.

0 Comments

Add a comment on LinkedIn...
No comments yet.
You can be the first!
Add a Comment Now

Be the first to know when I post articles like this.

Follow Me On LinkedIn