fix hermes path in case of single platform only#25
Open
revopushbot wants to merge 1 commit intomainfrom
Open
Conversation
kit2o
approved these changes
Apr 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Hermes detection for iOS-only and Android-only projects
Fixes #23
Problem
release-react fails with [Error] Unable to find gradle file "android/app" when run on an iOS-only project that has no
android/ directory. The inverse problem also exists: an Android-only project fails because ios/Podfile is not found.
The root cause was that Hermes detection and Hermes binary resolution unconditionally attempted to read both platform's
config files, regardless of the target platform.
Changes (script/react-native-utils.ts)
isHermesEnabled()— now only invokes the check for the relevant platform. Previously it called both getAndroidHermesEnabled()and getiOSHermesEnabled() on every invocation, causing an unnecessary cross-platform file read that could fail.
getiOSHermesEnabled()— when ios/Podfile is not found at its default path (no --podFile flag provided), falls back to theReact Native version heuristic (Hermes is the default engine since RN 0.70.0) instead of throwing. If the user explicitly
passed --podFile some/path and that file does not exist, the original clear error is still raised.
getHermesCommand()— wraps the getHermesCommandFromGradle() call in a try/catch so that missing gradle files (e.g. iOS-onlyproject) are silently skipped and resolution continues to the node_modules fallback chain.
parseBuildGradleFile()— wraps fs.lstatSync() in a try/catch so a completely missing android/ directory produces the existinguser-friendly error message instead of a raw ENOENT from Node.