@@ -2,7 +2,6 @@ apply plugin: "com.android.application"
22apply plugin : " kotlin-android"
33
44import com.android.build.OutputFile
5- import org.apache.tools.ant.taskdefs.condition.Os
65
76/**
87 * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
@@ -148,21 +147,18 @@ android {
148147 externalNativeBuild {
149148 ndkBuild {
150149 arguments " APP_PLATFORM=android-21" ,
151- " APP_STL=c++_shared" ,
152- " NDK_TOOLCHAIN_VERSION=clang" ,
153- " GENERATED_SRC_DIR=$buildDir /generated/source" ,
154- " PROJECT_BUILD_DIR=$buildDir " ,
155- " REACT_ANDROID_DIR=$rootDir /../node_modules/react-native/ReactAndroid" ,
156- " REACT_ANDROID_BUILD_DIR=$rootDir /../node_modules/react-native/ReactAndroid/build"
150+ " APP_STL=c++_shared" ,
151+ " NDK_TOOLCHAIN_VERSION=clang" ,
152+ " GENERATED_SRC_DIR=$buildDir /generated/source" ,
153+ " PROJECT_BUILD_DIR=$buildDir " ,
154+ " REACT_ANDROID_DIR=$rootDir /../node_modules/react-native/ReactAndroid" ,
155+ " REACT_ANDROID_BUILD_DIR=$rootDir /../node_modules/react-native/ReactAndroid/build" ,
156+ " NODE_MODULES_DIR=$rootDir /../node_modules"
157157 cFlags " -Wall" , " -Werror" , " -fexceptions" , " -frtti" , " -DWITH_INSPECTOR=1"
158158 cppFlags " -std=c++17"
159159 // Make sure this target name is the same you specify inside the
160160 // src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
161161 targets " enderchat_appmodules"
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- }
166162 }
167163 }
168164 if (! enableSeparateBuildPerCPUArchitecture) {
@@ -261,7 +257,8 @@ android {
261257
262258dependencies {
263259 implementation fileTree(dir : " libs" , include : [" *.jar" ])
264- implementation " org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion "
260+ implementation " org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion "
261+ implementation " androidx.core:core-ktx:1.5.0"
265262
266263 // noinspection GradleDynamicVersion
267264 implementation " com.facebook.react:react-native:+" // From node_modules
@@ -282,9 +279,10 @@ dependencies {
282279 }
283280
284281 if (enableHermes) {
285- def hermesPath = " ../../node_modules/hermes-engine/android/" ;
286- debugImplementation files(hermesPath + " hermes-debug.aar" )
287- releaseImplementation files(hermesPath + " hermes-release.aar" )
282+ // noinspection GradleDynamicVersion
283+ implementation(" com.facebook.react:hermes-engine:+" ) { // From node_modules
284+ exclude group :' com.facebook.fbjni'
285+ }
288286 } else {
289287 implementation jscFlavor
290288 }
@@ -297,7 +295,11 @@ if (isNewArchitectureEnabled()) {
297295 configurations. all {
298296 resolutionStrategy. dependencySubstitution {
299297 substitute(module(" com.facebook.react:react-native" ))
300- .using(project(" :ReactAndroid" )). because(" On New Architecture we're building React Native from source" )
298+ .using(project(" :ReactAndroid" ))
299+ .because(" On New Architecture we're building React Native from source" )
300+ substitute(module(" com.facebook.react:hermes-engine" ))
301+ .using(project(" :ReactAndroid:hermes-engine" ))
302+ .because(" On New Architecture we're building Hermes from source" )
301303 }
302304 }
303305}
0 commit comments