-
-
Notifications
You must be signed in to change notification settings - Fork 605
Description
When building a React Native Android release on Windows, the build fails inside react-native-screens during the CMake/Ninja native compilation step. The error reports that a file path exceeds the maximum length, even though Windows long path support is enabled and the project is located at a short root path (C:\projectname).
This only starts happening on the second build because the first build generates additional nested directories under .cxx and Gradle cache transforms, which makes the final path exceed Windows/Ninja/NDK limits.
This appears to be related to deep nested Prefab/CMake paths inside react-native-screens, combined with React Native 0.81+, NDK 27, and CMake 3.22.
Error Outputs:
ninja: error: Stat(C:/Users/.../react-android-0.81.4-release/prefab/modules/reactnative/include/react/renderer/runtimescheduler/RuntimeSchedulerIntersectionObserverDelegate.h): Filename longer than 260 characters
Steps to Reproduce:
On Windows 10/11
Enable long paths via registry
Clone a React Native project using react-native-screens
Ensure NDK 27.x and CMake 3.22.x are installed
Run:
npx expo run:android
Second build always fails with the long-path error.
package.json:
{
"name": "appName",
"main": "expo-router/entry",
"version": "1.0.0",
"scripts": {
"start": "expo start",
"reset-project": "node ./scripts/reset-project.js",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web",
"lint": "expo lint",
"open-android": "cd android && open -a 'Android Studio' .",
"open-ios": "cd ios && open -a 'Xcode' ."
},
"dependencies": {
"@expo/vector-icons": "^15.0.2",
"@hookform/resolvers": "^5.2.2",
"@react-native-async-storage/async-storage": "^2.2.0",
"@react-native-community/netinfo": "^11.4.1",
"@react-native-picker/picker": "^2.11.4",
"@react-navigation/drawer": "^7.5.8",
"@react-navigation/elements": "^2.6.3",
"@react-navigation/native": "^7.1.8",
"@tanstack/react-query": "^5.90.2",
"axios": "^1.12.2",
"date-fns": "^4.1.0",
"expo": "~54.0.7",
"expo-build-properties": "~1.0.9",
"expo-constants": "~18.0.8",
"expo-dev-client": "~6.0.18",
"expo-font": "~14.0.8",
"expo-haptics": "~15.0.7",
"expo-linking": "~8.0.8",
"expo-router": "~6.0.4",
"expo-secure-store": "~15.0.7",
"expo-splash-screen": "~31.0.10",
"expo-status-bar": "~3.0.8",
"expo-system-ui": "~6.0.8",
"expo-web-browser": "~15.0.7",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-hook-form": "^7.62.0",
"react-native": "0.81.4",
"react-native-calendar-picker": "^8.0.5",
"react-native-dropdown-picker": "^5.4.6",
"react-native-gesture-handler": "~2.28.0",
"react-native-reanimated": "~4.1.0",
"react-native-safe-area-context": "~5.6.0",
"react-native-screens": "~4.16.0",
"react-native-toast-message": "^2.3.3",
"react-native-vector-icons": "^10.3.0",
"react-native-web": "~0.21.0",
"react-native-worklets": "0.5.1",
"yup": "^1.7.0"
},
"devDependencies": {
"@react-native-community/cli": "^20.0.1",
"@types/react": "~19.1.0",
"@types/react-native": "^0.72.8",
"eslint": "^9.25.0",
"eslint-config-expo": "~10.0.0",
"typescript": "~5.9.2"
},
"private": true
}