Skip to content

For React Native 0.82+, use hermesvm instead of libhermes #261

@gorkemogut

Description

@gorkemogut

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions