Skip to content

Commit d50f198

Browse files
committed
android example search for node_modules
1 parent 7538c01 commit d50f198

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

packages/sqlite-storage/example/android/build.gradle

+10-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,16 @@ buildscript {
2525
allprojects {
2626
repositories {
2727
maven {
28-
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
29-
url("${rootDir}/../../node_modules/react-native/android")
28+
url({
29+
def searchDir = rootDir.toPath()
30+
do {
31+
def p = searchDir.resolve("node_modules/react-native/android")
32+
if (p.toFile().exists()) {
33+
return p.toRealPath().toString()
34+
}
35+
} while (searchDir = searchDir.getParent())
36+
throw new GradleException("Could not find `react-native`");
37+
}())
3038
}
3139
mavenCentral()
3240
google()

0 commit comments

Comments
 (0)