Skip to content

Commit

Permalink
Merge pull request #44389 from software-mansion-labs/@jpiasecki/fix-f…
Browse files Browse the repository at this point in the history
…ailing-ci-build

Fix Android builds failing often on CI
  • Loading branch information
AndrewGable authored Jun 25, 2024
2 parents fe7748b + 68188b4 commit 2ef919c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,23 @@ android {
}
}

afterEvaluate {
// As the App 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.
def hermesCTask = gradle.includedBuild("react-native").task(":packages:react-native:ReactAndroid:hermes-engine:buildHermesC")

android.applicationVariants.configureEach { variant ->
if (variant.buildType.name == "release") {
def variantName = variant.name.capitalize()
def bundleTask = tasks.named("createBundle${variantName}JsAndAssets").getOrNull()

if (bundleTask != null) {
bundleTask.dependsOn(hermesCTask)
}
}
}
}

dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
Expand Down

0 comments on commit 2ef919c

Please sign in to comment.