I am currently facing an issue where whenever I try to build my react-native project with react-native-reanimated installed the project fails to compile. When I uninstall react-native-reanimated¨the entire project builds and runs successfully.
I have tried to reset the cache by running
npm run start --clear-cache
And
npx react-native run-android
The version installed is:
"react-native-reanimated": "^3.3.0",
This is the output that I receive whenever I try to run the project with the package installed. I suspect that there is a mismatch between the package version and gradle. However 3.3.0 is the latest release of the package.
> Configure project :react-native-reanimated
No AAR for react-native-reanimated found. Attempting to build from source.
Android gradle plugin: 7.4.1
Gradle: 7.5.1
...
-- Build files have been written to: C:/Work/repositories/react-native-client/node_modules/react-native-reanimated/android/.cxx/Debug/181x6l2t/arm64-v8a
C++ build system [build] failed while executing:
@echo off
"C:\Users\AppData\Local\Android\Sdk\cmake\3.22.1\bin\ninja.exe" ^
-C ^
"C:\Work\repositories\react-native-client\node_modules\react-native-reanimated\android\.cxx\Debug\181x6l2t\arm64-v8a" ^
reanimated
from C:Workrepositoriesreact-native-clientnode_modulesreact-native-reanimatedandroid
ninja: error: manifest 'build.ninja' still dirty after 100 tries
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
BUILD FAILED in 35s
at makeError (....react-native-clientnode_modulesexecaindex.js:174:9)
at ....react-native-clientnode_modulesexecaindex.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (....react-native-clientnode_modules@react-native-communitycli-platform-androidbuildcommandsrunAndroidrunOnAllDevices.js:82:7)
at async Command.handleAction (....react-native-clientnode_modules@react-native-communityclibuildindex.js:108:9)
info Run CLI with --verbose flag for more details.
Whenever I try to run the ./gradlew clean script in the android folder I also receive an No such file or directory error. I also suspect that it has something to do with the permissions or the react-native-reanimated based on other similar issues from other users.
./gradlew clean
:ReactNative:Running '[node, -e, try {console.log(require('@react-native-community/cli').bin);} catch (e) {console.log(require('react-native/cli').bin);}]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script '/mnt/c/repositories/Pension/react-native-client/node_modules/@react-native-community/cli-platform-android/native_modules.gradle' line: 397
* What went wrong:
A problem occurred evaluating script.
> Cannot run program "node" (in directory "/mnt/c/repositories/Pension/react-native-client/android"): error=2, No such file or directory
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
How can I solve this issue?
2
Answers
try adding this line in your babel.config.js
Reanimated v3.x.x require
React-native
0.7x.x, trying to upgrade yoru react native version