Skip to content

Commit 50b1270

Browse files
tomekzawfacebook-github-bot
authored andcommitted
Remove unused variable NODE_MODULES_DIR from build.gradle in app template (#34459)
Summary: This PR removes unused variable `NODE_MODULES_DIR` passed from `build.gradle` to `CMakeLists.txt` which causes the following CMake warnings to appear in the logs: ``` > Task :app:configureCMakeDebug[arm64-v8a] C/C++: debug|arm64-v8a :CMake Warning: C/C++: debug|arm64-v8a : Manually-specified variables were not used by the project: C/C++: debug|arm64-v8a : NODE_MODULES_DIR ``` First I changed the value of `NODE_MODULES_DIR` to some non-existent path (i.e. `-DNODE_MODULES_DIR=/foo/bar`) to confirm that the variable is indeed unused. Then I completely removed it from `arguments` and the CMake warning disappeared. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Android] [Fixed] - Removed unused variable `NODE_MODULES_DIR` from `build.gradle` in app template Pull Request resolved: #34459 Test Plan: 1. Create a new RN 0.70.0-rc.3 app from template with `npx react-native@next init RN070RC3 --version 0.70.0-rc.3` 2. Set `newArchEnabled=true` in `settings.gradle` 3. Open `android` directory in Android Studio 4. Run Gradle Sync 5. Build the app 6. Search for `NODE_MODULES_DIR` in the logs 7. Notice the CMake warning 8. Remove the line from this PR 9. Build the app again 10. Search for `NODE_MODULES_DIR` in the logs 11. Confirm there are no occurrences Reviewed By: neildhar Differential Revision: D38864127 Pulled By: cortinico fbshipit-source-id: b41440edcdba63945e3b08cef897a250686c13ba
1 parent e142de0 commit 50b1270

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

template/android/app/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ android {
157157
arguments "-DPROJECT_BUILD_DIR=$buildDir",
158158
"-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
159159
"-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
160-
"-DNODE_MODULES_DIR=$rootDir/../node_modules",
161160
"-DTARGET_NAME=$dynamicLibraryName",
162161
"-DANDROID_STL=c++_shared"
163162
}

0 commit comments

Comments
 (0)