-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Description
Starting from react-native version 0.80 javascript core was removed as a runtime, and instead @react-native-community/javascriptcore is suggested to use. For performance reasons we need to do that, but this is incompatible with react-native-reanimated.
The build fails with a CMake error related to ReactAndroid::jsctooling.
Expected Behavior
App should build and run successfully using @react-native-community/javascriptcore instead of Hermes.
Actual Behavior
Build fails with the following CMake errors:
Execution failed for task ':react-native-reanimated:configureCMakeDebug[arm64-v8a]'.
CMake Error at src/main/cpp/worklets/CMakeLists.txt:16 (add_library):
Target "worklets" links to target "ReactAndroid::jsctooling" but the target
was not found.
Perhaps a find_package() call is missing for an IMPORTED target,
or an ALIAS target is missing?
CMake Error at src/main/cpp/reanimated/CMakeLists.txt:10 (add_library):
Target "reanimated" links to target "ReactAndroid::jsctooling" but the target
was not found.
This seems to be the result from:
| target_link_libraries(worklets ReactAndroid::jsctooling) |
react-native removed jsctooling for external jsc versions with facebook/react-native#49365
This is also an issue with the New Architecture enabled and react-native-reanimated version 4.
How do you make react-native-reanimated work with @react-native-community/javascriptcore?
Any help or suggestions would be greatly appreciated!
Steps to reproduce
- Download the repository created from the following steps:
a. Create a React Native Comunity CLI project.
b. Install@react-native-community/javascriptcoreand update Gradle files.
c. Installreact-native-reanimated. - Run the app:
npx react-native run-android. - Observe the build failure during the CMake configuration step in
react-native-reanimated.
Snack or a link to a repository
https://github.com/emjeku/test-react-native-reanimated-with-jsc-community
Reanimated version
3.19.3
Worklets version
React Native version
0.81.4
Platforms
Android
JavaScript runtime
JSC
Workflow
React Native CLI
Architecture
Legacy Architecture (Paper renderer)
Reanimated feature flags
No
React Native release level
Stable
Build type
Debug app & dev bundle
Device
Real device
Host machine
Linux
Device model
Samsung Galaxy A51 Android 13
Acknowledgements
Yes