react-native-worklets-core icon indicating copy to clipboard operation
react-native-worklets-core copied to clipboard

For React Native 0.82+, use hermesvm instead of libhermes

Open gorkemogut opened this issue 3 months ago • 0 comments

libhermes is incompatible with RN0.82

android/CMakeLists.txt should be updated

Here is the patch to solve for now:

diff --git a/node_modules/react-native-worklets-core/android/CMakeLists.txt b/node_modules/react-native-worklets-core/android/CMakeLists.txt
index cc4cbfe..9f94f1c 100644
--- a/node_modules/react-native-worklets-core/android/CMakeLists.txt
+++ b/node_modules/react-native-worklets-core/android/CMakeLists.txt
@@ -79,10 +79,18 @@ if(${JS_RUNTIME} STREQUAL "hermes")
 
   string(APPEND CMAKE_CXX_FLAGS " -DJS_RUNTIME_HERMES=1")
 
-  target_link_libraries(
-    ${PACKAGE_NAME}
-    hermes-engine::libhermes
-  )
+  # For React Native 0.82+, use hermesvm instead of libhermes
+  if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 82)
+    target_link_libraries(
+      ${PACKAGE_NAME}
+      hermes-engine::hermesvm
+    )
+  else()
+    target_link_libraries(
+      ${PACKAGE_NAME}
+      hermes-engine::libhermes
+    )
+  endif()
 
   if(${HERMES_ENABLE_DEBUGGER})
     if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)

gorkemogut avatar Oct 09 '25 16:10 gorkemogut