Home > database >  React Native - Could not determine the dependencies of task ':react-native-reanimated:generateJ
React Native - Could not determine the dependencies of task ':react-native-reanimated:generateJ

Time:08-28

I am facing this issue. Can anyone help me out?  while running react native application. I am getting this error. I installed all the dependencies and software that were required even though I was getting this

> Configure project :react-native-reanimated
Native libs debug enabled: false
Android gradle plugin: 4.1.1
Gradle: 6.7.1
building Reanimated2

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':react-native-reanimated:generateJsonModelDebug'.
> CMake '3.18.1' was not found in PATH or by cmake.dir property.

* 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 8s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with
 --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] android: `react-native run-android`
npm ERR! Exit status 1

CodePudding user response:

The new version of react-native-reanimated (v2.10.0) has this issue as discussed here and here. A PR has been created to fix this issue. So till a new version is released, you can try these workarounds -

Install CMake 3.18.1 using CLI or Android Studio.

CLI

$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "cmake;3.18.1"

Android Studio

Go to Tools > SDK Manager > SDK Tools > Show Package Details and select CMake version 3.18.1 and Apply.

Rebuild the app. If it's still failing then downgrade the package to previous version and rebuild.

yarn add [email protected]
OR
npm install [email protected]
  • Related