I create a new React Native Project and I install React Native Navigation and React Native Stack Navigation.
npm install @react-navigation/native
npm install @react-navigation/stack
npm install react-native-gesture-handler
I use these commands for this. Version are all latest.
"dependencies": {
"@react-navigation/native": "^7.0.0",
"@react-navigation/stack": "^7.0.0",
"react": "18.3.1",
"react-native": "0.76.1",
"react-native-gesture-handler": "^2.20.2"},
This show an error on run.
(node:16556) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
info Installing the app...
> Task :app:configureCMakeDebug[arm64-v8a] FAILED
C/C++: CMake Error at D:/React Native/ReactNative-Stylish-App/android/app/build/generated/autolinking/src/main/jni/Android-autolinking.cmake:9 (add_subdirectory):
C/C++: add_subdirectory called with incorrect number of arguments
C/C++: Call Stack (most recent call first):
C/C++: D:/React Native/ReactNative-Stylish-App/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:86 (include)
C/C++: CMakeLists.txt:31 (include)
C/C++: CMake Error at D:/React Native/ReactNative-Stylish-App/node_modules/react-native/ReactAndroid/cmake-utils/ReactNative-application.cmake:89 (target_link_libraries):
C/C++: Cannot specify link libraries for target
C/C++: "react_codegen_rngesturehandler_codegen" which is not built by this
C/C++: project.
C/C++: Call Stack (most recent call first):
C/C++: CMakeLists.txt:31 (include)
> Task :react-native-gesture-handler:compileDebugKotlin FAILED
55 actionable tasks: 24 executed, 31 up-to-date
Please help me how to solve this issue.
These errors are caused by white spaces in the folder name, such as React Native.
Problem solved after changing the name to ReactNative.