-1

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]'

DineshMsd
  • 72
  • 1
  • 9
  • It might help to use ```useLegacyImplementation``` (https://stackoverflow.com/questions/76817139/react-native-ios-drawer-partially-opened-on-login?noredirect=1#comment135424003_76817139) – Michael Bahl Aug 16 '23 at 14:37
  • @MichaelBahl unfortunately the above errors persists. adding `useLegacyImplementation={true}` flag didn't works – DineshMsd Aug 16 '23 at 17:00
  • What is your current ```com.android.tools.build:gradle```version? – Michael Bahl Aug 17 '23 at 05:34
  • @MichaelBahl My gradle version is 8.0.1, also I made a edit the question with the approach I have tried earlier today. please take a look at this. Thanks! – DineshMsd Aug 17 '23 at 09:01

1 Answers1

0

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

DineshMsd
  • 72
  • 1
  • 9