RocketChat / RocketChat/Rocket.Chat.ReactNative

bug: Android build fails on Windows due to 260-character path limit (CMake/Ninja)

Open
#6,923 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🐛 bug
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
  1. Clone the latest commit (ad2f552c8 as of this writing).
  2. Run yarn install
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.