Skip to content

Commit 16b2165

Browse files
committed
Remove support for RN <0.71 on Android
1 parent e6ed072 commit 16b2165

File tree

1 file changed

+1
-43
lines changed

1 file changed

+1
-43
lines changed

android/build.gradle

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -29,43 +29,6 @@ def getVersionOrDefault(String flagName, String defaultVersion) {
2929
rootProject.hasProperty(flagName) ? rootProject.properties[flagName] : defaultVersion
3030
}
3131

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-
6932
def isNewArchitectureEnabled() {
7033
// To opt-in for the New Architecture, you can either:
7134
// - Set `newArchEnabled` to true inside the `gradle.properties` file
@@ -210,10 +173,5 @@ dependencies {
210173
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesTest_version"
211174
}
212175

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
219177
}

0 commit comments

Comments
 (0)