RocketChat / RocketChat/Rocket.Chat.ReactNative
bug: Android build fails on Windows due to 260-character path limit (CMake/Ninja)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 1.5k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 90
Description
Describe the Bug
On Windows, the Android build fails during native compilation because CMake/Ninja hits the 260-character filename path limit. This happens due to deeply nested paths generated by React Native codegen / JSI modules.
This issue is not visible on macOS/Linux and can block Windows contributors during setup.
Steps to Reproduce
- Clone the latest commit (
ad2f552c8as of this writing). - Run
yarn install - Run
yarn android
Expected Behavior
The Android app should build successfully on Windows with standard setup steps.
Actual Behavior
Running:
yarn android
fails with the following error:
ninja: error: Filename longer than 260 characters
Example failing path:
ninja: error: Stat(
reactnativekeyboardcontroller_autolinked_build/CMakeFiles/
react_codegen_reactnativekeyboardcontroller.dir/
C_/Users/DHRUVI/RCRN/node_modules/react-native-keyboard-controller/android/
build/generated/source/codegen/jni/react/renderer/components/
reactnativekeyboardcontroller/
reactnativekeyboardcontrollerJSI-generated.cpp.o
): Filename longer than 260 characters
The full path exceeds Windows’ default 260 character path limit, causing the native build to fail.
Additional Context
- OS: Windows 11
- Java : Jdk-17
- Gradle: 8.13
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure on Windows 11 with JDK 17 and Gradle 8.13 by running yarn install followed by yarn android. Inspect the generated CMake/Ninja path shown in the error, including the React Native codegen and JSI module directories. Done means the Android app builds successfully using the standard setup steps without the 260-character path error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, cmake, react-native
- Domain
- build-system, mobile, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100