diff --git a/android/build.gradle b/android/build.gradle index 89ea486f6d..b2a4b88a15 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -22,6 +22,10 @@ buildscript { } } +def isRunningInContextOfScreensRepo() { + return project == rootProject +} + def isNewArchitectureEnabled() { // To opt-in for the New Architecture, you can either: // - Set `newArchEnabled` to true inside the `gradle.properties` file @@ -31,7 +35,7 @@ def isNewArchitectureEnabled() { } // spotless is only accessible within react-native-screens repo -if (project == rootProject) { +if (isRunningInContextOfScreensRepo()) { apply from: 'spotless.gradle' } @@ -58,7 +62,7 @@ def resolveReactNativeDirectory() { } def reactNativeFromAppNodeModules = file("${projectDir}/../../react-native") - if (reactNativeFromAppNodeModules.exists()) { + if (!isRunningInContextOfScreensRepo() && reactNativeFromAppNodeModules.exists()) { return reactNativeFromAppNodeModules } @@ -68,7 +72,7 @@ def resolveReactNativeDirectory() { } throw new GradleException( - "[RNScreens] Unable to resolve react-native location in node_modules. You should project extension property (in `app/build.gradle`) `REACT_NATIVE_NODE_MODULES_DIR` with path to react-native." + "[RNScreens] Unable to resolve react-native location in node_modules. You should add project extension property (in `app/build.gradle`) `REACT_NATIVE_NODE_MODULES_DIR` with path to react-native." ) } diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 9946c0130b..567ad65ab4 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip