Skip to content

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

@dhruvi-16-me

Description

@dhruvi-16-me

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions