11apply plugin : " com.android.application"
22
33import com.android.build.OutputFile
4- import org.apache.tools.ant.taskdefs.condition.Os
54
65/**
76 * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
@@ -152,17 +151,13 @@ android {
152151 " GENERATED_SRC_DIR=$buildDir /generated/source" ,
153152 " PROJECT_BUILD_DIR=$buildDir " ,
154153 " REACT_ANDROID_DIR=$rootDir /../node_modules/react-native/ReactAndroid" ,
155- " REACT_ANDROID_BUILD_DIR=$rootDir /../node_modules/react-native/ReactAndroid/build"
154+ " REACT_ANDROID_BUILD_DIR=$rootDir /../node_modules/react-native/ReactAndroid/build" ,
155+ " NODE_MODULES_DIR=$rootDir /../node_modules"
156156 cFlags " -Wall" , " -Werror" , " -fexceptions" , " -frtti" , " -DWITH_INSPECTOR=1"
157157 cppFlags " -std=c++17"
158158 // Make sure this target name is the same you specify inside the
159159 // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
160160 targets " helloworld_appmodules"
161-
162- // Fix for windows limit on number of character in file paths and in command lines
163- if (Os . isFamily(Os . FAMILY_WINDOWS )) {
164- arguments " NDK_APP_SHORT_COMMANDS=true"
165- }
166161 }
167162 }
168163 if (! enableSeparateBuildPerCPUArchitecture) {
@@ -282,9 +277,10 @@ dependencies {
282277 }
283278
284279 if (enableHermes) {
285- def hermesPath = " ../../node_modules/hermes-engine/android/" ;
286- debugImplementation files(hermesPath + " hermes-debug.aar" )
287- releaseImplementation files(hermesPath + " hermes-release.aar" )
280+ // noinspection GradleDynamicVersion
281+ implementation(" com.facebook.react:hermes-engine:+" ) { // From node_modules
282+ exclude group :' com.facebook.fbjni'
283+ }
288284 } else {
289285 implementation jscFlavor
290286 }
@@ -297,7 +293,11 @@ if (isNewArchitectureEnabled()) {
297293 configurations. all {
298294 resolutionStrategy. dependencySubstitution {
299295 substitute(module(" com.facebook.react:react-native" ))
300- .using(project(" :ReactAndroid" )). because(" On New Architecture we're building React Native from source" )
296+ .using(project(" :ReactAndroid" ))
297+ .because(" On New Architecture we're building React Native from source" )
298+ substitute(module(" com.facebook.react:hermes-engine" ))
299+ .using(project(" :ReactAndroid:hermes-engine" ))
300+ .because(" On New Architecture we're building Hermes from source" )
301301 }
302302 }
303303}
0 commit comments