Skip to content

[Android/Windows] ninja mkdir fails for arm64-v8a build: absolute path with drive letter creates unresolvable C_/ directory #263

@atuldedha

Description

@atuldedha

Environment

  • OS: Windows 11
  • @rive-app/react-native version: 0.4.6
  • React Native version: 0.83.6
  • Expo SDK: 53
  • Build tool: expo run:android / gradlew assembleDebug
  • CMake: 3.22.1 (Android SDK bundled)
  • Ninja: bundled with Android SDK CMake

What went wrong

Building @rive-app/react-native for arm64-v8a on Windows fails with:

ninja: error: mkdir(CMakeFiles/rive.dir/C_/Users//...//node_modules/@rive-app/react-native/nitrogen/generated): No such file or directory

Steps to reproduce

  1. Create a React Native / Expo project on Windows
  2. Install @rive-app/react-native
  3. Run npx expo run:android or ./gradlew assembleDebug

Root cause

CMakeLists.txt references source files in nitrogen/generated/ using absolute paths
(e.g. C:/Users/.../node_modules/@rive-app/react-native/nitrogen/generated/SomeFile.cpp).

When CMake maps an absolute Windows path to an object file output path, it replaces
the drive letter colon (C:) with C_, producing:

CMakeFiles/rive.dir/C_/Users/.../nitrogen/generated/SomeFile.cpp.o

Ninja then calls mkdir on this path to create the output directory.
On Windows, Ninja's mkdir does not create intermediate directories
(unlike mkdir -p on Unix). Since C_/ doesn't exist inside the CMake
build directory, mkdir fails with No such file or directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidbugSomething isn't workingquestionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions