From a18bad4555c62f35ff56e14f9f801f4adec19eac Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 22 Feb 2023 09:18:32 -0800 Subject: [PATCH] Re-add repositories{} block to allow for build-from-source Summary: I've just tested the nightly and the build from source is broken as the `repositories{}` block is missing. Normally RNGP will take care of setting repositories for everyone, but this is triggered by the app-module. When building from source, the app module of the user is isolated from the included build of React Native, therefore the repositories{} definitions are not passed over. Without this, the build fails with: ``` Cannot resolve external dependency ... because no repositories are defined ``` Changelog: [Internal] [Changed] - Re-add repositories{} block to allow for build-from-source Reviewed By: cipolleschi Differential Revision: D43501011 fbshipit-source-id: b41c56c62839163ad210e7e303940dec0a9001da --- ReactAndroid/build.gradle | 8 ++++++++ ReactAndroid/hermes-engine/build.gradle | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index bcc8cda5aff..99ca6704863 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -418,6 +418,14 @@ task installArchives { dependsOn("publishAllPublicationsToNpmRepository") } +repositories { + // Normally RNGP will set repositories for all modules, + // but when consumed from source, we need to re-declare + // those repositories as there is no app module there. + mavenCentral() + google() +} + android { buildToolsVersion = "33.0.0" compileSdkVersion 33 diff --git a/ReactAndroid/hermes-engine/build.gradle b/ReactAndroid/hermes-engine/build.gradle index 5bf2330276f..b76ed652c2c 100644 --- a/ReactAndroid/hermes-engine/build.gradle +++ b/ReactAndroid/hermes-engine/build.gradle @@ -116,6 +116,14 @@ def reactNativeArchitectures() { return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] } +repositories { + // Normally RNGP will set repositories for all modules, + // but when consumed from source, we need to re-declare + // those repositories as there is no app module there. + mavenCentral() + google() +} + android { compileSdkVersion 31 buildToolsVersion = "31.0.0"