fix(react-native): resolve included-build gradle.properties from parent build in monorepos#55569
Open
fix(react-native): resolve included-build gradle.properties from parent build in monorepos#55569
Conversation
…nt build in monorepos React Native’s included build was reading only ../../android/gradle.properties, which breaks in monorepos where Android apps live under packages/*/android. This updates settings.gradle.kts to resolve gradle.properties from the parent Gradle start parameters (projectDir/currentDir) first, with the old relative path kept as a backward-compatible fallback. This ensures hermesV1Enabled and react.hermesV1Enabled are propagated reliably across composite builds.
cortinico
reviewed
Feb 16, 2026
Contributor
cortinico
left a comment
There was a problem hiding this comment.
So do you build from source + are in a monorepo?
Can you clarify where your top level gradle.properties live?
Comment on lines
+49
to
+52
| val parentGradle = gradle.parent | ||
| val parentProjectDir = parentGradle?.startParameter?.projectDir | ||
| val parentCurrentDir = parentGradle?.startParameter?.currentDir | ||
| val gradlePropertiesCandidates = |
Contributor
There was a problem hiding this comment.
let's add some comments here.
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.
Disclaimer: The code was generated using GPT-5.3 Codex. I have read it, and it looks fine, but I'm no android expert. I made sure with logging that everything worked.
Summary:
React Native’s included build was reading only ../../android/gradle.properties, which breaks in monorepos where Android apps live under packages/*/android. This updates settings.gradle.kts to resolve gradle.properties from the parent Gradle start parameters (projectDir/currentDir) first, with the old relative path kept as a backward-compatible fallback. This ensures hermesV1Enabled and react.hermesV1Enabled are propagated reliably across composite builds.
Changelog:
[ANDROID] [FIXED] Fix included-build
gradle.propertiesresolution for monorepos by reading from parent Gradle start parameters (projectDir/currentDir) before falling back to../../android/gradle.properties, sohermesV1Enabledcan be inherited correctly.Test Plan:
I've tested manually with expo sdk 55 in our monorepo.
Ideally we'll want this in 83, so that expo 55 can use hermes V1 in monorepos