software-mansion / react-native-reanimated

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

Execution failed for task ':react-native-reanimated:buildCMakeRelWithDebInfo[armeabi-v7a] #6718

Open s1tony opened 4 days ago

s1tony commented 4 days ago

Description

While performing Release Build of my React Native App, I receive the following exception (note, Debug build works):

Steps to reproduce

  1. npm start -- --reset-cache
  2. npm run android-coin-release

Snack or a link to a repository

https://github.com/s1tony/Collections2

Reanimated version

3.16.1

React Native version

0.76.1

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Fabric (New Architecture)

Build type

Release app & production bundle

Device

Real device

Device model

Samsung S22

Acknowledgements

Yes

tjzel commented 2 days ago

Hi @s1tony, can you check if a clean rebuild the project in Android Studio helps? This might be a cache issue.

s1tony commented 1 day ago

Hi @tjzel, I build from the command line, not with Android Studio, and this is what I have tried:

npm start -- --reset-cache ./gradlew clean (In android dir) npm run

Same result:

C++ build system [build] failed while executing: @echo off "C:\Users\Tony\AppData\Local\Android\Sdk\cmake\3.22.1\bin\ninja.exe" ^ -C ^ "K:\Source\collections-source\Collections\node_modules\react-native-reanimated\android\.cxx\RelWithDebInfo\1y5e2947\armeabi-v7a" ^ reanimated ^ worklets from K:\Source\collections-source\Collections\nodemodules\react-native-reanimated\android ninja: error: mkdir(src/main/cpp/reanimated/CMakeFiles/reanimated.dir/K/Source/collections-source/Collections/node_modules/react-native-reanimated/Common): No such file or directory

This seems very weird to me:

src/main/cpp/reanimated/CMakeFiles/reanimated.dir/K_/Source/collections-source/Collections/node_modules/react-native-reanimated/Common

tjzel commented 1 day ago

./gradlew clean is not exactly a full clean when dealing with React Native. Sometimes I have to do git clean -Xdf because ./gradlew clean fails to execute.

src/main/cpp/reanimated/CMakeFiles/reanimated.dir/K_/Source/collections-source/Collections/node_modules/react-native-reanimated/Common

This is indeed a very weird path. Unfortunately I'm not familiar with the quirks of building React Native on Windows.

You can try ./gradlew --console verbose --no-build-cache -d assembleDebug to get more compilation logs.

s1tony commented 1 day ago

I was excited to try git clean -Xdf, but still the same result:

Task :react-native-reanimated:buildCMakeRelWithDebInfo[armeabi-v7a] FAILED C/C++: ninja: error: mkdir(src/main/cpp/reanimated/CMakeFiles/reanimated.dir/K_/Source/collections-source/Collections/node_modules/react-native-reanimated/Common): No such file or directory 288 actionable tasks: 278 executed, 10 up-to-date

Maybe I should try an older version of react-native-reanimated? What is weirder is how debug builds work.

s1tony commented 1 day ago

I even tried to delete and reinstall node_modules, but to no avail.

2004durgesh commented 1 day ago

It guess this might be related to [this React Native issue](https://github.com/facebook/react-native/issues/47626), which was addressed in [this pull request](https://github.com/facebook/react-native/pull/47641). While the fix has been merged, no new version of React Native has been released yet, so version 0.76.2 may still have this issue. This could potentially explain why it’s affecting react-native-reanimated as well.

I guess this is also the reason why windows hosted ci is failing (am i correct @tjzel on this ?) image

For now, you could try using expo-go, disabling newArchEnabled in your app.json, or switching to a different version of React Native as a temporary solution.

tjzel commented 1 day ago

I was just looking into it @2004durgesh, it seems to be that since we get on CI:

Screenshot 2024-11-21 at 15 00 17

Good catch!

bicanezin commented 21 hours ago

I resolve my problem moving the project to another folder. The path was too long