Skip to content

Commit

Permalink
Add dependency on task building hermes
Browse files Browse the repository at this point in the history
  • Loading branch information
j-piasecki committed Jun 25, 2024
1 parent 0bcd005 commit 68188b4
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 68188b4

Please sign in to comment.