From 2d8c6f591c3c17b75afced101a2f86e773e98a54 Mon Sep 17 00:00:00 2001 From: monholm <73996878+monholm@users.noreply.github.com> Date: Wed, 8 May 2024 02:27:23 -0700 Subject: [PATCH] docs(react-native): fix app build.gradle react config default paths (#44472) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Minor inconvenience I noticed while doing some testing in a mono-repo. The current paths points to the android folder, but should point to the project root. Currently the android build fails if one uncomments the folder paths as they are. ## Changelog: [ANDROID] [FIXED] - Fix incorrect paths in app build.gradle react config block Pull Request resolved: https://github.com/facebook/react-native/pull/44472 Test Plan: Uncomment the paths are they are and notice the android build error: ``` FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring project ':app'. > Failed to notify project evaluation listener. > /xyz/xyz/xyz/xyz/RNPathTester/android/node_modules/react-native/ReactAndroid/gradle.properties (No such file or directory) ``` Use the updated paths and notice the build succeeds 🥳 Reviewed By: GijsWeterings Differential Revision: D57093768 Pulled By: cipolleschi fbshipit-source-id: 8472151c74c7aa5c51dc75f9adda6116387bdf99 --- .../template/android/app/build.gradle | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/react-native/template/android/app/build.gradle b/packages/react-native/template/android/app/build.gradle index c0e79300890..d57c2176fbb 100644 --- a/packages/react-native/template/android/app/build.gradle +++ b/packages/react-native/template/android/app/build.gradle @@ -8,14 +8,14 @@ apply plugin: "com.facebook.react" */ react { /* Folders */ - // The root of your project, i.e. where "package.json" lives. Default is '..' - // root = file("../") - // The folder where the react-native NPM package is. Default is ../node_modules/react-native - // reactNativeDir = file("../node_modules/react-native") - // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen - // codegenDir = file("../node_modules/@react-native/codegen") - // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js - // cliFile = file("../node_modules/react-native/cli.js") + // The root of your project, i.e. where "package.json" lives. Default is '../..' + // root = file("../../") + // The folder where the react-native NPM package is. Default is ../../node_modules/react-native + // reactNativeDir = file("../../node_modules/react-native") + // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen + // codegenDir = file("../../node_modules/@react-native/codegen") + // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js + // cliFile = file("../../node_modules/react-native/cli.js") /* Variants */ // The list of variants to that are debuggable. For those we're going to