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

Execution failed for task ':realm:buildCMakeDebug[arm64-v8a][realm-js-android-binding]'. #6890

Closed
shadhussain-crgl opened this issue Sep 10, 2024 · 4 comments

Comments

@shadhussain-crgl
Copy link

How frequently does the bug occur?

Always

Description

When I try to run the app on Android (using yarn android), I see this error.

Stacktrace & log output

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':realm:buildCMakeDebug[arm64-v8a][realm-js-android-binding]'.
> com.android.ide.common.process.ProcessException: ninja: Entering directory `/node_modules/realm/binding/android/.cxx/Debug/2h5h5b5k/arm64-v8a'
  [1/2] Building CXX object CMakeFiles/realm-js-android-binding.dir/node_modules/realm/binding/jsi/react_scheduler.cpp.o
  FAILED: CMakeFiles/realm-js-android-binding.dir/node_modules/realm/binding/jsi/react_scheduler.cpp.o 
  /Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android28 --sysroot=/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -DREALM_APP_SERVICES=1 -DREALM_DEBUG=1 -DREALM_ENABLE_SYNC=1 -DREALM_HAVE_EPOLL=1 -Drealm_js_android_binding_EXPORTS -I/node_modules/realm/binding/android/.. -I/node_modules/realm/binding/android/../../binding/jsi -I/node_modules/realm/binding/android/../../bindgen/src -I/node_modules/realm/binding/android/../../bindgen/vendor/realm-core/bindgen/src -I/node_modules/react-native/ReactCommon/callinvoker -isystem /node_modules/realm/prebuilds/android/arm64-v8a/include -isystem/node_modules/realm/binding/android/.cxx/Debug/2h5h5b5k/arm64-v8a/openssl/include -isystem /.gradle/caches/transforms-3/ff19347be33af2ca9ddb9b1ffb77594b/transformed/jetified-react-android-0.71.19-debug/prefab/modules/jsi/include -isystem /.gradle/caches/transforms-3/ff19347be33af2ca9ddb9b1ffb77594b/transformed/jetified-react-android-0.71.19-debug/prefab/modules/reactnativejni/include -isystem /.gradle/caches/transforms-3/ff19347be33af2ca9ddb9b1ffb77594b/transformed/jetified-react-android-0.71.19-debug/prefab/modules/turbomodulejsijni/include -isystem/.gradle/caches/transforms-3/30df754dac6cfeddd7164e9b452901f9/transformed/jetified-fbjni-0.3.0/prefab/modules/fbjni/include -O2 -std=c++20 -frtti -fexceptions -Wall -fstack-protector-all -g  -fno-limit-debug-info -fPIC -fvisibility=hidden -pthread -MD -MT CMakeFiles/realm-js-android-binding.dir/node_modules/realm/binding/jsi/react_scheduler.cpp.o -MF CMakeFiles/realm-js-android-binding.dir/node_modules/realm/binding/jsi/react_scheduler.cpp.o.d -o CMakeFiles/realm-js-android-binding.dir/node_modules/realm/binding/jsi/react_scheduler.cpp.o -c /node_modules/realm/binding/jsi/react_scheduler.cpp
  /node_modules/realm/binding/jsi/react_scheduler.cpp:24:10: fatal error: 'ReactCommon/SchedulerPriority.h' file not found
  #include <ReactCommon/SchedulerPriority.h>
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  ninja: build stopped: subcommand failed.
  
  C++ build system [build] failed while executing:
      /Library/Android/sdk/cmake/3.22.1/bin/ninja \
        -C \
        /node_modules/realm/binding/android/.cxx/Debug/2h5h5b5k/arm64-v8a \
        realm-js-android-binding
    from /node_modules/realm/binding/android

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':realm:buildCMakeDebug[arm64-v8a][realm-js-android-binding]'.
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:142)
	at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:140)
	at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:128)
	at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77)
	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:56)
	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:69)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:327)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:314)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:307)
	at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:293)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:420)
	at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:342)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
Caused by: org.gradle.internal.UncheckedException: com.android.ide.common.process.ProcessException: ninja: Entering directory `/node_modules/realm/binding/android/.cxx/Debug/2h5h5b5k/arm64-v8a'
[1/2] Building CXX object CMakeFiles/realm-js-android-binding.dir/node_modules/realm/binding/jsi/react_scheduler.cpp.o
FAILED: CMakeFiles/realm-js-android-binding.dir/node_modules/realm/binding/jsi/react_scheduler.cpp.o 
/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android28 --sysroot=/Library/Android/sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -DREALM_APP_SERVICES=1 -DREALM_DEBUG=1 -DREALM_ENABLE_SYNC=1 -DREALM_HAVE_EPOLL=1 -Drealm_js_android_binding_EXPORTS -I/node_modules/realm/binding/android/.. -I/node_modules/realm/binding/android/../../binding/jsi -I/node_modules/realm/binding/android/../../bindgen/src -I/node_modules/realm/binding/android/../../bindgen/vendor/realm-core/bindgen/src -I/node_modules/react-native/ReactCommon/callinvoker -isystem /node_modules/realm/prebuilds/android/arm64-v8a/include -isystem /node_modules/realm/binding/android/.cxx/Debug/2h5h5b5k/arm64-v8a/openssl/include -isystem /.gradle/caches/transforms-3/ff19347be33af2ca9ddb9b1ffb77594b/transformed/jetified-react-android-0.71.19-debug/prefab/modules/jsi/include -isystem /.gradle/caches/transforms-3/ff19347be33af2ca9ddb9b1ffb77594b/transformed/jetified-react-android-0.71.19-debug/prefab/modules/reactnativejni/include -isystem /.gradle/caches/transforms-3/ff19347be33af2ca9ddb9b1ffb77594b/transformed/jetified-react-android-0.71.19-debug/prefab/modules/turbomodulejsijni/include -isystem /.gradle/caches/transforms-3/30df754dac6cfeddd7164e9b452901f9/transformed/jetified-fbjni-0.3.0/prefab/modules/fbjni/include -O2 -std=c++20 -frtti -fexceptions -Wall -fstack-protector-all -g  -fno-limit-debug-info -fPIC -fvisibility=hidden -pthread -MD -MT CMakeFiles/realm-js-android-binding.dir/node_modules/realm/binding/jsi/react_scheduler.cpp.o -MF CMakeFiles/realm-js-android-binding.dir/node_modules/realm/binding/jsi/react_scheduler.cpp.o.d -o CMakeFiles/realm-js-android-binding.dir/node_modules/realm/binding/jsi/react_scheduler.cpp.o -c /node_modules/realm/binding/jsi/react_scheduler.cpp
/node_modules/realm/binding/jsi/react_scheduler.cpp:24:10: fatal error: 'ReactCommon/SchedulerPriority.h' file not found
#include <ReactCommon/SchedulerPriority.h>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.

Can you reproduce the bug?

Always

Reproduction Steps

yarn react-native run-android

Version

16.0

What services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

MacOS // Android 11

Build environment

Yarn: 1.22.22
Gradle: 7.5.1
JVM: 11.0.24

Cocoapods version

1.15.2

Copy link

sync-by-unito bot commented Sep 10, 2024

➤ PM Bot commented:

Jira ticket: RJS-2904

@shadhussain-crgl
Copy link
Author

To follow up, for it to work on iOS with the pod install command, I have the versions of key dependencies set as so:

@realm/react: "^0.5.0",
react-native: "^0.71.4",
realm: "12.13.1"

If I try to change the react-native version, for example, pod install fails.

@kraenhansen
Copy link
Member

kraenhansen commented Sep 10, 2024

Thanks for taking the time to fill out a detailed report. Your version of react-native however, is more than 2 years old. We can't reasonably support and test that far back. Please upgrade react-native to a more recent version or pin realm@12.11.1.

@kraenhansen kraenhansen closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2024
@shadhussain-crgl
Copy link
Author

Appreciate your speedy responses, definitely a big help. Changing to realm@12.11.1 resolved the build issues, it builds now for both iOS and Android.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants