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

Build failed on android with "Task : android:buildCMakeDebug[arm64-v8a] FAILED" #46491

Open
parveen-bhatia opened this issue Sep 13, 2024 · 8 comments
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available Platform: Android Android applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@parveen-bhatia
Copy link

Description

After enabling new architecture using newArchEnabled=true in gradle.properties of android project. Not able to build android app on M1 mac

Steps to reproduce

  • Enable the new architecture in gradle.properties of android project by using newArchEnabled=true
  • Build the android project from Android Studio or use yarn android

React Native Version

0.74.3

Affected Platforms

Runtime - Android

Areas

Other (please specify)

Output of npx react-native info

OS: macOS 14.6.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 261.36 MB / 32.00 GB
  Shell:
    version: 5.2.26
    path: /opt/homebrew/bin/bash
Binaries:
  Node:
    version: 20.15.1
    path: ~/.nvm/versions/node/v20.15.1/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.7.0
    path: ~/.nvm/versions/node/v20.15.1/bin/npm
  Watchman:
    version: 2024.07.01.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.3 AI-233.14808.21.2331.11709847
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 1.8.0_402
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.3
    wanted: 0.74.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

> Task : android:buildCMakeDebug[arm64-v8a] FAILED
-MD -MT CMakeFiles/appmodules.dir/OnLoad.cpp.o -MF CMakeFiles/appmodules.dir/OnLoad.cpp.o.d -o CMakeFiles/appmodules.dir/OnLoad.cpp.o -c {path}/mobile/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp
C/C++: In file included from {path}/mobile/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:30:
C/C++: In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_newarchdefaults/include/DefaultComponentsRegistry.h:11:
C/C++: In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/fabricjni/include/react/fabric/ComponentFactory.h:11:
C/C++: In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/componentregistry/ComponentDescriptorFactory.h:12:
C/C++: In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/core/ComponentDescriptor.h:12:
C/C++: In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/core/Props.h:12:
C/C++: In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/core/PropsMacros.h:11:
C/C++: /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_utils/include/react/utils/fnv1a.h:24:37: error: no type named 'identity' in namespace 'std'; did you mean 'folly::Identity'?
C/C++: template <typename CharTransformT = std::identity>
C/C++:                                     ^~~~~
C/C++: /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/folly_runtime/include/folly/Utility.h:339:7: note: 'folly::Identity' declared here
C/C++: using Identity = identity_fn;
C/C++:       ^
C/C++: In file included from {path}/mobile/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:30:
C/C++: In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_newarchdefaults/include/DefaultComponentsRegistry.h:11:
C/C++: In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/fabricjni/include/react/fabric/ComponentFactory.h:11:
C/C++: In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/componentregistry/ComponentDescriptorFactory.h:12:
C/C++: In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/core/ComponentDescriptor.h:12:
C/C++: In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/core/Props.h:14:
C/C++: /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/core/RawProps.h:149:38: error: expected concept name with optional arguments
C/C++:   { T::filterRawProps(rawProps) } -> std::same_as<void>;
C/C++:                                      ^
C/C++: In file included from {path}/mobile/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:30:
C/C++: In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_newarchdefaults/include/DefaultComponentsRegistry.h:14:
C/C++: /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/core/ConcreteComponentDescriptor.h:108:19: error: use of undeclared identifier 'RawPropsFilterable'
C/C++:     if constexpr (RawPropsFilterable<ShadowNodeT>) {
C/C++:                   ^
C/C++: {path}/mobile/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:34:10: fatal error: 'rncli.h' file not found
C/C++: #include <rncli.h>
C/C++:          ^~~~~~~~~
C/C++: 4 errors generated.

Execution failed for task ': android:buildCMakeDebug[arm64-v8a]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/Users/{user_name}/repo/android-client/ android/.cxx/Debug/so123uq6/arm64-v8a'
  [0/2] Re-checking globbed directories...
  [1/2] Building CXX object CMakeFiles/appmodules.dir/OnLoad.cpp.o
  FAILED: CMakeFiles/appmodules.dir/OnLoad.cpp.o 
….
…
 -c {path}/mobile/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp
  In file included from {path}/mobile/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:30:
  In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_newarchdefaults/include/DefaultComponentsRegistry.h:11:
  In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/fabricjni/include/react/fabric/ComponentFactory.h:11:
  In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/componentregistry/ComponentDescriptorFactory.h:12:
  In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/core/ComponentDescriptor.h:12:
  In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/core/Props.h:12:
  In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/core/PropsMacros.h:11:
  /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_utils/include/react/utils/fnv1a.h:24:37: error: no type named 'identity' in namespace 'std'; did you mean 'folly::Identity'?
  template <typename CharTransformT = std::identity>
                                      ^~~~~
  /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/folly_runtime/include/folly/Utility.h:339:7: note: 'folly::Identity' declared here
  using Identity = identity_fn;
        ^
  In file included from {path}/mobile/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:30:
  In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_newarchdefaults/include/DefaultComponentsRegistry.h:11:
  In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/fabricjni/include/react/fabric/ComponentFactory.h:11:
  In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/componentregistry/ComponentDescriptorFactory.h:12:
  In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/core/ComponentDescriptor.h:12:
  In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/core/Props.h:14:
  /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/core/RawProps.h:149:38: error: expected concept name with optional arguments
    { T::filterRawProps(rawProps) } -> std::same_as<void>;
                                       ^
  In file included from {path}/mobile/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:30:
  In file included from /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_newarchdefaults/include/DefaultComponentsRegistry.h:14:
  /Users/{user_name}/.gradle/caches/transforms-4/e4ff38ca226999e5e3d63c74b8528558/transformed/react-android-0.74.3-debug/prefab/modules/react_nativemodule_core/include/react/renderer/core/ConcreteComponentDescriptor.h:108:19: error: use of undeclared identifier 'RawPropsFilterable'
      if constexpr (RawPropsFilterable<ShadowNodeT>) {
                    ^
  {path}/mobile/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:34:10: fatal error: 'rncli.h' file not found
  #include <rncli.h>
           ^~~~~~~~~
  4 errors generated.
  ninja: build stopped: subcommand failed.

* Try:
> Run with --info or --debug option to get more log output.
> Get more help at https://help.gradle.org.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ': android:buildCMakeDebug[arm64-v8a]'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:148)
	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:146)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:134)
	at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
	at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
	at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
	at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
	at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:331)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:318)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.lambda$execute$0(DefaultTaskExecutionGraph.java:314)
	at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)
Caused by: org.gradle.internal.UncheckedException: com.android.ide.common.process.ProcessException: ninja: Entering directory `/Users/{user_name}/repo/android-client/ android/.cxx/Debug/so123uq6/arm64-v8a'
[0/2] Re-checking globbed directories...

Reproducer

Couldn't share as it's organization private repo

Screenshots and Videos

No response

@parveen-bhatia parveen-bhatia added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Sep 13, 2024
@react-native-bot
Copy link
Collaborator

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.

@react-native-bot react-native-bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available labels Sep 13, 2024
@react-native-bot
Copy link
Collaborator

⚠️ Newer Version of React Native is Available!
ℹ️ You are on a supported minor version, but it looks like there's a newer patch available - 0.74.5. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@react-native-bot react-native-bot added the Platform: Android Android applications. label Sep 13, 2024
@react-native-bot
Copy link
Collaborator

⚠️ Missing Reproducible Example
ℹ️ We could not detect a reproducible example in your issue report. Please provide either:

@react-native-bot
Copy link
Collaborator

⚠️ Newer Version of React Native is Available!
ℹ️ You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

@migueldaipre
Copy link
Contributor

Please share a minimal reproducer

@cortinico
Copy link
Contributor

Couldn't share as it's organization private repo

As @migueldaipre, we would need a bit of more information.
Generally this kind of issues are due to @parveen-bhatia you using a different NDK version as the expected one

@parveen-bhatia
Copy link
Author

I tried using ndkVersion "26.1.10909125" and now getting only one error as below:

/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:34:10: fatal error: 'rncli.h' file not found
  #include <rncli.h>
           ^~~~~~~~~
  1 error generated.
  ninja: build stopped: subcommand failed.
  
  C++ build system [build] failed while executing:
      /Users/{user_name}/Library/Android/sdk/cmake/3.22.1/bin/ninja \
        -C \
        /Users/{user_name}/repo/android-client/android/.cxx/Debug/1f6nd2o2/arm64-v8a \
        appmodules
    from /Users/{user_name}/repo/android-client/]android

Please let me know if this is the expected ndkversion ?

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Sep 17, 2024
@cortinico
Copy link
Contributor

I tried using ndkVersion "26.1.10909125" and now getting only one error as below:

For 0.74, it's the one you specified: "26.1.10909125"

/node_modules/react-native/ReactAndroid/cmake-utils/default-app-setup/OnLoad.cpp:34:10: fatal error: 'rncli.h' file not found

This error happens when the autolinking coming from the CLI is not running.

The rncli.h file should be located at:

android/app/build/generated/rncli/src/main/jni/rncli.h

Without a reproducer I can't help you further as there are a number of reason why this could be failing (wrong package installed, wrong configuration in your .gradle files, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Newer Patch Available Platform: Android Android applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

4 participants