@@ -33,7 +33,8 @@ if (findNodeModulesPath("@expo/config-plugins", rootDir)) {
33
33
applyConfigPlugins(testAppDir, rootDir)
34
34
}
35
35
36
- def cliAndroidDir = findNodeModulesPath(" @react-native-community/cli-platform-android" , rootDir)
36
+ def reactNativeDir = file(findNodeModulesPath(" react-native" , rootDir))
37
+ def cliAndroidDir = findNodeModulesPath(" @react-native-community/cli-platform-android" , reactNativeDir)
37
38
apply(from : " ${ cliAndroidDir} /native_modules.gradle" )
38
39
39
40
ext. applyTestAppSettings = { DefaultSettings settings ->
@@ -46,8 +47,8 @@ ext.applyTestAppSettings = { DefaultSettings settings ->
46
47
.projectDir = file(" ${ testAppDir} /android/support" )
47
48
48
49
def reactNativeGradlePlugin =
49
- findNodeModulesPath(" @react-native/gradle-plugin" , settings . rootDir ) // >= 0.72
50
- ?: findNodeModulesPath(" react-native-gradle-plugin" , settings . rootDir ) // < 0.72
50
+ findNodeModulesPath(" @react-native/gradle-plugin" , reactNativeDir ) // >= 0.72
51
+ ?: findNodeModulesPath(" react-native-gradle-plugin" , reactNativeDir ) // < 0.72
51
52
if (reactNativeGradlePlugin != null ) {
52
53
settings. includeBuild(reactNativeGradlePlugin)
53
54
}
@@ -58,8 +59,6 @@ ext.applyTestAppSettings = { DefaultSettings settings ->
58
59
def usePrefabs = reactNativeVersion == 0 || reactNativeVersion >= 7100
59
60
60
61
if (isNewArchitectureEnabled(settings) && ! usePrefabs) {
61
- def reactNativeDir = findNodeModulesPath(" react-native" , settings. rootDir)
62
-
63
62
settings. include(" :ReactAndroid" )
64
63
settings. project(" :ReactAndroid" )
65
64
.projectDir = file(" ${ reactNativeDir} /ReactAndroid" )
0 commit comments