react-nativereact-navigationreact-native-reanimatedreact-navigation-drawer

Execution failed for task ':react-native-reanimated:configureCMakeDebug[arm64-v8a] [CXX1428] exception while building Json


I'm trying to use the Drawer Navigator from React Navigation in my React Native project. I've come across a similar issue that many others have faced when attempting to run the React Native app after integrating react-native-reanimated into their project. unfortunately I am not able to find the solution for the exact issue that I have.

Here are my dependencies versions:

React Native version: 0.72.3
React Native Reanimated version: ^3.4.2

I've included a screenshot of my package.json file for reference.

package json image

When I initiate the app using the command react-native run-android, I encounter the following error:

[CXX1416] Could not find Ninja on PATH or in SDK CMake bin folders.
[CXX1416] Could not find Ninja on PATH or in SDK CMake bin folders.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> [CXX1416] Could not find Ninja on PATH or in SDK CMake bin folders.

I've also attached a screenshot of the error. encountered error in terminal

Note: I am using Macbook Air M1 chip ventura 13.0 (22A380)

EDIT:

I assume Ninja is not installed or not properly configured in system's PATH. Ninja-build link

So I just Installed Ninja with

brew install ninja

And ran the clean up cd android ./gradlew clean

And restarted my project Now I am getting a different error

Attached error screenshot Similar issue that has told in this stack overflow question: Error while executing npx react-native run-android ==> Execution failed for task ':react-native-reanimated:configureCMakeDebug[arm64-v8a]'


Solution

  • Hi I am posting the answer it may help somebody.

    I encountered an issue that seemed to be related to conflicting versions of react-native and react-native-reanimated packages. By following these steps, I was able to resolve the problem After exploring the issues, I found that downgrading both react-native and react-native-reanimated helped resolve the problem. I am attaching the image of my updated dependencies without any issues:

    image of packagejson dependencies

    Also Its good to perform cleanup tasks after installing or uninstalling packages. This can help prevent a variety of unwanted issues.

    cd android
    

    To perform a Gradle clean:

    ./gradlew clean
    

    To Clear the Gradle build cache:

    ./gradle cleanBuildCache
    

    To clean the npm cache:

    npm start --reset-cache
    npm run android --reset-cache
    npm run iOS --reset-cache
    

    I also referred react-native drawer boilerplace code that someone did helped me to downgrade my project. Link to the github repo of react-native drawer boilerplate