diff --git a/packages/rn-tester/android/app/build.gradle b/packages/rn-tester/android/app/build.gradle index 739f1e2bb0d481..6100303bc10a57 100644 --- a/packages/rn-tester/android/app/build.gradle +++ b/packages/rn-tester/android/app/build.gradle @@ -226,11 +226,12 @@ dependencies { // Build React Native from source implementation project(':ReactAndroid') - implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" + // Consume Hermes as built from source only for the Hermes variant. + hermesImplementation(project(":ReactAndroid:hermes-engine")) { + exclude group:'com.facebook.fbjni' + } - def hermesPath = '$projectDir/../../../../../node_modules/hermes-engine/android/' - hermesDebugImplementation files(hermesPath + "hermes-debug.aar") - hermesReleaseImplementation files(hermesPath + "hermes-release.aar") + implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { exclude group:'com.facebook.fbjni' diff --git a/template/android/app/build.gradle b/template/android/app/build.gradle index a173c56b4e9897..2c96211af948fd 100644 --- a/template/android/app/build.gradle +++ b/template/android/app/build.gradle @@ -271,9 +271,10 @@ dependencies { } if (enableHermes) { - def hermesPath = "../../node_modules/hermes-engine/android/"; - debugImplementation files(hermesPath + "hermes-debug.aar") - releaseImplementation files(hermesPath + "hermes-release.aar") + //noinspection GradleDynamicVersion + implementation("com.facebook.react:hermes-engine:+") { // From node_modules + exclude group:'com.facebook.fbjni' + } } else { implementation jscFlavor } @@ -286,7 +287,11 @@ if (isNewArchitectureEnabled()) { configurations.all { resolutionStrategy.dependencySubstitution { substitute(module("com.facebook.react:react-native")) - .using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source") + .using(project(":ReactAndroid")) + .because("On New Architecture we're building React Native from source") + substitute(module("com.facebook.react:hermes-engine")) + .using(project(":ReactAndroid:hermes-engine")) + .because("On New Architecture we're building Hermes from source") } } } diff --git a/template/android/settings.gradle b/template/android/settings.gradle index 2f93b7115036f3..bd838b9c306d59 100644 --- a/template/android/settings.gradle +++ b/template/android/settings.gradle @@ -6,4 +6,6 @@ includeBuild('../node_modules/react-native-gradle-plugin') if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { include(":ReactAndroid") project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') + include(":ReactAndroid:hermes-engine") + project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine') }