Skip to content

Commit

Permalink
docs(react-native): fix app build.gradle react config default paths (#…
Browse files Browse the repository at this point in the history
…44472)

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:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID] [FIXED] - Fix incorrect paths in app build.gradle react config block

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[ANDROID] [FIXED] - Fix incorrect paths in app build.gradle react config block

Pull Request resolved: #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
  • Loading branch information
monholm authored and facebook-github-bot committed May 8, 2024
1 parent deee037 commit 2d8c6f5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/react-native/template/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2d8c6f5

Please sign in to comment.