From 2b640bec340491e82f61d696230be9de9d095fda Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Fri, 14 Jun 2024 11:11:20 -0700 Subject: [PATCH] Fix for broken test_helloworld_android on Release (#44952) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44952 The test_helloworld_android Release variant are broken on GHA. This fixes it as it forces hermesc to be built *before* the app attempts to create a bundle. Changelog: [Internal] [Changed] - Fix for broken test_helloworld_android on Release Reviewed By: cipolleschi, blakef Differential Revision: D58591480 fbshipit-source-id: 2afc1cfe8c416da6f5919d20098639653798dd1a --- packages/helloworld/android/app/build.gradle | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/helloworld/android/app/build.gradle b/packages/helloworld/android/app/build.gradle index 9518cf5ce7a..76fbb4d1557 100644 --- a/packages/helloworld/android/app/build.gradle +++ b/packages/helloworld/android/app/build.gradle @@ -137,3 +137,11 @@ dependencies { implementation jscFlavor } } + +afterEvaluate { + // As HelloWorld is building from source, we need to make sure hermesc is built before the JS bundle is created. + // Otherwise the release version of the app will fail to build due to missing hermesc. + tasks + .getByName("createBundleReleaseJsAndAssets") + .dependsOn(gradle.includedBuild("react-native").task(":packages:react-native:ReactAndroid:hermes-engine:buildHermesC")) +}