@@ -29,43 +29,6 @@ def getVersionOrDefault(String flagName, String defaultVersion) {
29
29
rootProject. hasProperty(flagName) ? rootProject. properties[flagName] : defaultVersion
30
30
}
31
31
32
- def resolveReactNativeDirectory () {
33
- def reactNativeLocation = safeExtGet(" REACT_NATIVE_NODE_MODULES_DIR" , null )
34
- if (reactNativeLocation != null ) {
35
- return file(reactNativeLocation)
36
- }
37
-
38
- // monorepo workaround
39
- // react-native can be hoisted or in project's own node_modules
40
- def reactNativeFromProjectNodeModules = file(" ${ rootProject.projectDir} /../node_modules/react-native" )
41
- if (reactNativeFromProjectNodeModules. exists()) {
42
- return reactNativeFromProjectNodeModules
43
- }
44
-
45
- def reactNativeFromNodeModulesWithAsyncStorage = file(" ${ projectDir} /../../react-native" )
46
- if (reactNativeFromNodeModulesWithAsyncStorage. exists()) {
47
- return reactNativeFromNodeModulesWithAsyncStorage
48
- }
49
-
50
- throw new Exception (
51
- " [react-native-async-storage] Unable to resolve react-native location in " +
52
- " node_modules. You should add project extension property (in app/build.gradle) " +
53
- " `REACT_NATIVE_NODE_MODULES_DIR` with path to react-native."
54
- )
55
- }
56
-
57
- def getReactNativeMinorVersion () {
58
- def REACT_NATIVE_DIR = resolveReactNativeDirectory()
59
-
60
- def reactProperties = new Properties ()
61
- file(" $REACT_NATIVE_DIR /ReactAndroid/gradle.properties" ). withInputStream { reactProperties. load(it) }
62
-
63
- def REACT_NATIVE_VERSION = reactProperties. getProperty(" VERSION_NAME" )
64
- def REACT_NATIVE_MINOR_VERSION = REACT_NATIVE_VERSION . startsWith(" 0.0.0-" ) ? 1000 : REACT_NATIVE_VERSION . split(" \\ ." )[1 ]. toInteger()
65
-
66
- return REACT_NATIVE_MINOR_VERSION
67
- }
68
-
69
32
def isNewArchitectureEnabled () {
70
33
// To opt-in for the New Architecture, you can either:
71
34
// - Set `newArchEnabled` to true inside the `gradle.properties` file
@@ -210,10 +173,5 @@ dependencies {
210
173
testImplementation " org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesTest_version "
211
174
}
212
175
213
- // noinspection GradleDynamicVersion
214
- if (isNewArchitectureEnabled() && getReactNativeMinorVersion() < 71 ) {
215
- implementation project(" :ReactAndroid" )
216
- } else {
217
- implementation ' com.facebook.react:react-native:+' // from node_modules
218
- }
176
+ implementation ' com.facebook.react:react-native:+' // from node_modules
219
177
}
0 commit comments