Skip to content

fix(react-native): resolve included-build gradle.properties from parent build in monorepos#55569

Open
Titozzz wants to merge 1 commit intomainfrom
titozzz/hermesv1monorepo
Open

fix(react-native): resolve included-build gradle.properties from parent build in monorepos#55569
Titozzz wants to merge 1 commit intomainfrom
titozzz/hermesv1monorepo

Conversation

@Titozzz
Copy link
Collaborator

@Titozzz Titozzz commented Feb 16, 2026

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.properties resolution for monorepos by reading from parent Gradle start parameters (projectDir/currentDir) before falling back to ../../android/gradle.properties, so hermesV1Enabled can 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

…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.
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 16, 2026
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Feb 16, 2026
Copy link
Contributor

@cortinico cortinico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add some comments here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants