Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛] react-native-reanimated:buildCMakeDebug[arm64-v8a] FAILED only in Windows #6872

Open
roshan-appsndevices opened this issue Jan 7, 2025 · 8 comments
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android

Comments

@roshan-appsndevices
Copy link

Description

Description
This issue is only in windows , mac there is no problem,
With yarn android the build Build failed with an exception, i am not able to build the app

the length of the path is within 250 characters.

System:
OS: Windows 11 10.0.26100
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
Memory: 1.22 GB / 15.78 GB
Binaries:
Node:
version: 20.0.0
path: C:\Program Files\nodejs\node.EXE
Yarn:
version: 1.22.22
path: C:\Program Files\nodejs\yarn.CMD
npm:
version: 9.6.4
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels:

  • "34"
  • "35"
  • "35"
    Build Tools:
  • 29.0.3
  • 33.0.1
  • 34.0.0
  • 35.0.0
  • 36.0.0
    System Images:
  • android-35 | Google Play Intel x86_64 Atom
    Android NDK: Not Found
    Windows SDK: Not Found
    IDEs:
    Android Studio: AI-242.23339.11.2421.12700392
    Visual Studio: Not Found
    Languages:
    Java: 17.0.12
    Ruby: Not Found
    npmPackages:
    "@react-native-community/cli":
    installed: 15.1.3
    wanted: ^15.1.3
    react:
    installed: 18.2.0
    wanted: 18.2.0
    react-native:
    installed: 0.73.11
    wanted: ^0.73.0
    react-native-windows: Not Found
    npmGlobalPackages:
    "react-native": Not Found
    Android:
    hermesEnabled: true
    newArchEnabled: false
    iOS:
    hermesEnabled: Not found
    newArchEnabled: Not found

I am getting the following error:

FAILURE: Build failed with an exception.

Task :react-native-reanimated:configureCMakeDebug[arm64-v8a]
C/C++: CMake Warning in src/main/cpp/reanimated/CMakeLists.txt:
C/C++: The object file directory
C/C++: C:/circle_mobile/circle-mobile-app/examples/SampleApp/node_modules/react-native-reanimated/android/.cxx/Debug/3z1d2p4v/arm64-v8a/src/main/cpp/reanimated/CMakeFiles/reanimated.dir/./
C/C++: has 181 characters. The maximum full path to an object file is 250
C/C++: characters (see CMAKE_OBJECT_PATH_MAX). Object file
C/C++: C_/circle_mobile/circle-mobile-app/examples/SampleApp/node_modules/react-native-reanimated/Common/cpp/reanimated/RuntimeDecorators/ReanimatedWorkletRuntimeDecorator.cpp.o
C/C++: cannot be safely placed under this directory. The build may not work
C/C++: correctly.

Task :react-native-reanimated:buildCMakeDebug[arm64-v8a]
C/C++: ninja: error: mkdir(src/main/cpp/reanimated/CMakeFiles/reanimated.dir/C_/circle_mobile/circle-mobile-app/examples/SampleApp/node_modules/react-native-reanimated): No such file or directory

What went wrong:
Execution failed for task ':react-native-reanimated:buildCMakeDebug[arm64-v8a]'.
com.android.ide.common.process.ProcessException: ninja: Entering directory `C:\circle_mobile\circle-mobile-app\examples\SampleApp\node_modules\react-native-reanimated\android.cxx\Debug\3z1d2p4v\arm64-v8a'
[0/2] Re-checking globbed directories...
[1/37] Building CXX object src/main/cpp/worklets/CMakeFiles/worklets.dir/d536b8feb34efab1abcdea8f294526a3/Registries/WorkletRuntimeRegistry.cpp.o
[2/37] Building CXX object src/main/cpp/worklets/CMakeFiles/worklets.dir/70f724fbe71ffd138f810d7a60f0a7cf/worklets/Tools/ReanimatedJSIUtils.cpp.o
[3/37] Building CXX object src/main/cpp/worklets/CMakeFiles/worklets.dir/bc49fa34ae189dcf36c57bfc2721d736/cpp/worklets/Tools/JSScheduler.cpp.o
[4/37] Building CXX object src/main/cpp/worklets/CMakeFiles/worklets.dir/b0b56584fcb3aa7f8f210ba0045a58e4/Common/cpp/worklets/Tools/JSLogger.cpp.o
[5/37] Building CXX object src/main/cpp/worklets/CMakeFiles/worklets.dir/bc49fa34ae189dcf36c57bfc2721d736/cpp/worklets/Tools/AsyncQueue.cpp.o
[6/37] Building CXX object src/main/cpp/worklets/CMakeFiles/worklets.dir/bc49fa34ae189dcf36c57bfc2721d736/cpp/worklets/Tools/JSISerializer.cpp.o
[7/37] Building CXX object src/main/cpp/worklets/CMakeFiles/worklets.dir/70f724fbe71ffd138f810d7a60f0a7cf/worklets/Tools/WorkletEventHandler.cpp.o
[8/37] Building CXX object src/main/cpp/reanimated/CMakeFiles/reanimated.dir/8ea88b84efb26eb58b6d8ba349f65392/Fabric/PropsRegistry.cpp.o
[9/37] Building CXX object src/main/cpp/worklets/CMakeFiles/worklets.dir/d536b8feb34efab1abcdea8f294526a3/Registries/EventHandlerRegistry.cpp.o
[10/37] Building CXX object src/main/cpp/reanimated/CMakeFiles/reanimated.dir/8ea88b84efb26eb58b6d8ba349f65392/Fabric/ReanimatedCommitHook.cpp.o
[11/37] Building CXX object src/main/cpp/reanimated/CMakeFiles/reanimated.dir/8ea88b84efb26eb58b6d8ba349f65392/Fabric/ShadowTreeCloner.cpp.o
[12/37] Building CXX object src/main/cpp/reanimated/CMakeFiles/reanimated.dir/8ea88b84efb26eb58b6d8ba349f65392/Fabric/ReanimatedMountHook.cpp.o
[13/37] Building CXX object src/main/cpp/reanimated/CMakeFiles/reanimated.dir/54d6330cf11627d0dd1501ed01b2d737/LayoutAnimationsProxy.cpp.o
[14/37] Building CXX object src/main/cpp/reanimated/CMakeFiles/reanimated.dir/54d6330cf11627d0dd1501ed01b2d737/LayoutAnimationsUtils.cpp.o
ninja: build stopped: .

C++ build system [build] failed while executing:
@echo off
"C:\Users\User\AppData\Local\Android\Sdk\cmake\3.22.1\bin\ninja.exe" ^
-C ^
"C:\circle_mobile\circle-mobile-app\examples\SampleApp\node_modules\react-native-reanimated\android.cxx\Debug\3z1d2p4v\arm64-v8a" ^
reanimated ^
worklets
from C:\circle_mobile\circle-mobile-app\examples\SampleApp\node_modules\react-native-reanimated\android
ninja: error: mkdir(src/main/cpp/reanimated/CMakeFiles/reanimated.dir/C_/circle_mobile/circle-mobile-app/examples/SampleApp/node_modules/react-native-reanimated): No such file or directory

i have tried many solutions nothing seems to be working can any one give me some solution.

Steps to reproduce

clone the repo
follow the steps https://github.com/GetStream/stream-chat-react-native/tree/develop/examples/SampleApp
build the project using yarn android
this issue is only on windows laptop

Snack or a link to a repository

https://github.com/GetStream/stream-chat-react-native/tree/develop/examples/SampleApp

Reanimated version

3.16.6

React Native version

0.73.0

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Platform: Android This issue is specific to Android Missing repro This issue need minimum repro scenario labels Jan 7, 2025
Copy link

github-actions bot commented Jan 7, 2025

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@roshan-appsndevices
Copy link
Author

@harshitparkar-ardent
Copy link

Same issue on Android.

Version -
"react-native-reanimated": "^3.16.6",
"react": "18.3.1",
"react-native": "0.76.5",

FAILURE: Build failed with an exception.
 
* What went wrong:
Execution failed for task ':react-native-reanimated:buildCMakeDebug[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `C:\Users\Tushar\ReactNative\DrawerNavigation2\node_modules\react-native-reanimated\android\.cxx\Debug\5xx5w472\arm64-v8a'
  [0/2] Re-checking globbed directories...
  ninja: build stopped:
 
  C++ build system [build] failed while executing:
      @echo off
      "C:\\Users\\Tushar\\AppData\\Local\\Android\\Sdk\\cmake\\3.22.1\\bin\\ninja.exe" ^
        -C ^
        "C:\\Users\\Tushar\\ReactNative\\DrawerNavigation2\\node_modules\\react-native-reanimated\\android\\.cxx\\Debug\\5xx5w472\\arm64-v8a" ^
        reanimated ^
        worklets
    from C:\Users\Tushar\ReactNative\DrawerNavigation2\node_modules\react-native-reanimated\android
  ninja: error: mkdir(src/main/cpp/reanimated/CMakeFiles/reanimated.dir/C_/Users/Tushar/ReactNative/DrawerNavigation2/node_modules/react-native-reanimated): No such file or directory

@Sanjayng125
Copy link

Same issue

@Sakshiwanode
Copy link

facing same error and tried possible solutions but still not fixed on windows
"react-native-reanimated": "^3.16.5",
"react": "18.3.1",
"react-native": "0.76.3",

Task :react-native-reanimated:buildCMakeDebug[arm64-v8a] FAILED
C/C++: ninja: error: mkdir(src/main/cpp/reanimated/CMakeFiles/reanimated.dir/C_/Users/Soluzione/Desktop/NewLendMantra/Lendmantra/node_modules/react-native-reanimated): No such file or directory

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.10.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
328 actionable tasks: 15 executed, 313 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-reanimated:buildCMakeDebug[arm64-v8a]'.

com.android.ide.common.process.ProcessException: ninja: Entering directory `C:\Users\Soluzione\Desktop\NewLendMantra\Lendmantra\node_modules\react-native-reanimated\android.cxx\Debug\1t4r306k\arm64-v8a'
[0/2] Re-checking globbed directories...
ninja: build stopped: .

C++ build system [build] failed while executing:
@echo off
"C:\Users\Soluzione\AppData\Local\Android\Sdk\cmake\3.22.1\bin\ninja.exe" ^
-C ^
"C:\Users\Soluzione\Desktop\NewLendMantra\Lendmantra\node_modules\react-native-reanimated\android\.cxx\Debug\1t4r306k\arm64-v8a" ^
reanimated ^
worklets
from C:\Users\Soluzione\Desktop\NewLendMantra\Lendmantra\node_modules\react-native-reanimated\android
ninja: error: mkdir(src/main/cpp/reanimated/CMakeFiles/reanimated.dir/C_/Users/Soluzione/Desktop/NewLendMantra/Lendmantra/node_modules/react-native-reanimated): No such file or directory

@roshan-appsndevices
Copy link
Author

reduce you file directory to the least as possible eg : c/project
this worked for me

@ankitparekh9000
Copy link

How to Fix CMake Build Issue for React Native Reanimated

Question: How can I resolve CMake build errors related to react-native-reanimated, such as the following error path:
src/main/cpp/reanimated/CMakeFiles/reanimated.dir/...?

Answer:

Clean and Reinstall:

Run ./gradlew clean in the android folder to clean the build.

Delete node_modules and reinstall dependencies using npm install or yarn install.

Clear Metro Bundler Cache:

Use npx react-native start --reset-cache to clear the bundler cache.

Verify CMake and NDK Versions:

Check your android/build.gradle file to ensure compatible versions of CMake and NDK. For example:

buildToolsVersion = "34.0.0"
cmakeVersion = "3.22.1"
ndkVersion = "25.2.9519653"

Rebuild the App:

Run npx react-native run-android to rebuild the app and resolve the issue.

**Notes:

If the issue persists, ensure you’re using the latest version of react-native-reanimated and check your Android Studio setup for updates.**

Update Fast #ReactNative2024 OR Any Solu" then Update Here

@ankitparekh9000
Copy link

reduce you file directory to the least as possible eg : c/project this worked for me

Hi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android
Projects
None yet
Development

No branches or pull requests

5 participants