diff --git a/android/build.gradle b/android/build.gradle index 697feea..2f5f708 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -7,9 +7,10 @@ static def findNodeModules(baseDir) { // Node's module resolution algorithm searches up to the root directory, // after which the base path will be null while (basePath) { - def candidatePath = Paths.get(basePath.toString(), "node_modules") - if (candidatePath.toFile().exists()) { - return candidatePath.toString() + def nodeModulesPath = Paths.get(basePath.toString(), "node_modules") + def reactNativePath = Paths.get(nodeModulesPath.toString(), "react-native") + if (nodeModulesPath.toFile().exists() && reactNativePath.toFile().exists()) { + return nodeModulesPath.toString() } basePath = basePath.getParent() }