software-mansion / software-mansion/react-native-reanimated

[Android] Fix CMake build on React Native 0.81: use jsctooling instead of jscexecutor

Open
#8,906 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Missing repro Platform: Android
Dominant language
TypeScript
Stars
11k
Forks
1.5k
Avg merge
3d 4h
Merged PRs (30d)
172

Description

Description
### Environment
- **react-native-worklets**: 0.5.1
- **React Native**: 0.81.x (Expo SDK 54)
- **Platform**: Android

### Problem
On Android with React Native 0.81, the CMake build fails with:

CMake Error at CMakeLists.txt:59 (add_library):
Target "worklets" links to target "ReactAndroid::jscexecutor" but the
target was not found. Perhaps a find_package() call is missing for an
IMPORTED target, or an ALIAS target is missing?


In RN 0.81 the prefab no longer exposes `ReactAndroid::jscexecutor`; the correct target is `ReactAndroid::jsctooling`.

### Suggested fix
In `android/CMakeLists.txt`, for the JSC branch, use `jsctooling` for RN 0.81+ and keep `jscexecutor` for 0.76–0.80:

```cmake
elseif(${JS_RUNTIME} STREQUAL "jsc")
  if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 81)
    # RN 0.81+ uses jsctooling (jscexecutor target removed in prefab)
    target_link_libraries(worklets ReactAndroid::jsctooling)
  elseif(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
    target_link_libraries(worklets ReactAndroid::jscexecutor)
  else()
    target_link_libraries(worklets ReactAndroid::jscexecutor)
  endif()
Patch file

We use this as a patch-package patch; the generated patch is in patches/react-native-worklets+0.5.1.patch (it also includes minor formatting/whitespace changes). The important part is the JSC branch above.

Happy to open a PR if you prefer.


### Steps to reproduce

1. Créer un projet Expo SDK 54 (React Native 0.81) ou utiliser un projet existant avec ces versions.
2. Installer `react-native-reanimated` (qui tire `react-native-worklets@0.5.1`) et configurer le plugin Babel si besoin.
3. Lancer un build Android (EAS Build ou `expo run:android` / `./gradlew assembleRelease`).
4. La phase CMake de `react-native-worklets` échoue avec l’erreur : `Target "worklets" links to target "ReactAndroid::jscexecutor" but the target was not found`.

**En résumé** : avec React Native 0.81 + JSC, le build Android échoue car le prefab n’expose plus la cible `ReactAndroid::jscexecutor`, utilisée par `react-native-worklets` pour RN >= 76.

### Snack or a link to a repository

N/A – Projet privé. Je peux fournir les logs complets du build EAS (phase "Run gradlew") si besoin.

### Reanimated version

~4.1.1

### Worklets version

0.5.1

### React Native version

0.81.5

### Platforms

Android

### JavaScript runtime

None

### Workflow

None

### Architecture

None

### Reanimated feature flags

None

### React Native release level

None

### Build type

_No response_

### Device

_No response_

### Host machine

None

### Device model

_No response_

### Acknowledgements

No

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in android/CMakeLists.txt and inspect the JSC branch and ReactAndroid version handling. Reproduce with React Native 0.81.5 and JSC using an Android Gradle or CMake build; done means RN 0.81 builds without the missing jscexecutor target while RN 0.76–0.80 remains supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, cmake, react-native
Domain
build-system, mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.