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
- Create a React Native / Expo project on Windows
- Install
@rive-app/react-native
- 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.
Environment
What went wrong
Building
@rive-app/react-nativeforarm64-v8aon 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
@rive-app/react-nativenpx expo run:androidor./gradlew assembleDebugRoot cause
CMakeLists.txtreferences source files innitrogen/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:) withC_, producing:CMakeFiles/rive.dir/C_/Users/.../nitrogen/generated/SomeFile.cpp.o
Ninja then calls
mkdiron this path to create the output directory.On Windows, Ninja's
mkdirdoes not create intermediate directories(unlike
mkdir -pon Unix). SinceC_/doesn't exist inside the CMakebuild directory,
mkdirfails withNo such file or directory.