Open s1tony opened 4 days ago
Hi @s1tony, can you check if a clean rebuild the project in Android Studio helps? This might be a cache issue.
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
./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.
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.
I even tried to delete and reinstall node_modules, but to no avail.
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 ?)
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.
I was just looking into it @2004durgesh, it seems to be that since we get on CI:
Good catch!
I resolve my problem moving the project to another folder. The path was too long
Description
While performing Release Build of my React Native App, I receive the following exception (note, Debug build works):
What went wrong: Execution failed for task ':react-native-reanimated:buildCMakeRelWithDebInfo[armeabi-v7a]'.
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
Steps to reproduce
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