software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
8.89k stars 1.3k forks source link

Build failure for Windows 10 #6224

Closed kaustavb79 closed 2 months ago

kaustavb79 commented 3 months ago

Description

Hi, I created a react native project using react-native-cli on Windows 10 and add the react-native-reanimated package and follow the instruction mentioned in the README.md file of the package. When I tried to install app on android emulator using the following command npx react-native run-android the build got stuck at react-native-reanimated and after 10-15 min it gave build failure error. Below I have pasted the build error screenshots. I have created a dummy project with the exact same package version as my origin app for testing and the app gets build successfully. Shared the repo link too.

Screenshot (18) Screenshot (10) Screenshot (11) Screenshot (12) Screenshot (13) Screenshot (14) Screenshot (15)

Screenshot (16) Screenshot (17)

Operating System

Windows 10

CMake

Version: 3.29.6

NodeJS

Version: 2.15.0

npm

Version: 10.7.0

yarn

Version: 1.22.22

Android SDK

Version: 14 (UpsideDownCake) ---- Level : 34

Watchman

Version: 20240616.093132.0

Steps to reproduce

1 Open Android Studio

  1. Create a virtual device with Android 14 (Level : 34)
  2. Run the device
  3. Pull the dev branch from t he git repo provided.
  4. cd Reactnativeproj1
  5. npm install
  6. npx react-native run-android

Snack or a link to a repository

https://github.com/kaustavb79/Reactnativeproj1.git

Reanimated version

3.12.1

React Native version

0.74.1

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Paper (Old Architecture)

Build type

None

Device

Android emulator

Device model

Pixel 8 --- Android 14

Acknowledgements

Yes

szydlovsky commented 3 months ago

@kaustavb79 you have no babel plugin in your repo. I recommend visiting installation guide and adding it. Let me know if it helps

kaustavb79 commented 3 months ago

Check the dev branch. It's the updated one.

https://github.com/kaustavb79/Reactnativeproj1/blob/dev/babel.config.js

kaustavb79 commented 3 months ago

Check the dev branch. It's the updated one.

https://github.com/kaustavb79/Reactnativeproj1/blob/dev/babel.config.js

This is working in Ubuntu 20.04 LTS and also in Mac but not in Windows 10.

szydlovsky commented 3 months ago

@kaustavb79 okay, what is your NDK version? When searching for similar issues (and we have had a bunch of them already - it doesn't hurt to search:) ) I found that it often comes down to wrong version. See for example this

MatiPl01 commented 3 months ago

@kaustavb79 It might be also related to the path length limit issue. See this comment with links to proposed solutions and check if some of these work for you.

kaustavb79 commented 2 months ago

@kaustavb79 okay, what is your NDK version? When searching for similar issues (and we have had a bunch of them already - it doesn't hurt to search:) ) I found that it often comes down to wrong version. See for example this

NDK version is 26.1.10909125

kaustavb79 commented 2 months ago

@kaustavb79 It might be also related to the path length limit issue. See this comment with links to proposed solutions and check if some of these work for you.

Is there a way to update the path limit?

MatiPl01 commented 2 months ago

@kaustavb79 It might be also related to the path length limit issue. See this comment with links to proposed solutions and check if some of these work for you.

Is there a way to update the path limit?

You can try this and see if it works. Alternatively, just try to move your project to the shortest possible path (e.g. temporarily just store it in the root directory of your drive).

If it doesn't work for you, maybe try this one.

kaustavb79 commented 2 months ago

I checked the file path length and its 78 and default max length limit set by default is 260 characters. I moved it to C:\Users\msi-kb but it still gave the same error. ninja.exe is not getting installed. It disappears after opening a blank command prompt for 3-4 seconds.

kaustavb79 commented 2 months ago

It worked. Enabled the Win32 long path flag from registry by following the steps from below link.

https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry

MatiPl01 commented 2 months ago

It worked. Enabled the Win32 long path flag from registry by following the steps from below link.

https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry

I'm glad that you were able to fix the issue. Thank you for letting us know how you solved the problem.