Skip to content

fix: react-native@0.76.0 Android compatibility #84

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

Conversation

efstathiosntonas
Copy link
Contributor

Updated CMakeLists.txt to comply with new react-native@0.76.0 specs

@efstathiosntonas efstathiosntonas marked this pull request as ready for review October 31, 2024 07:03
@efstathiosntonas
Copy link
Contributor Author

Hi @numandev1, this is good to go.

For those who can't wait:

react-native-keys+0.7.10.patch

diff --git a/node_modules/react-native-keys/android/CMakeLists.txt b/node_modules/react-native-keys/android/CMakeLists.txt
index f453363..8f262ec 100644
--- a/node_modules/react-native-keys/android/CMakeLists.txt
+++ b/node_modules/react-native-keys/android/CMakeLists.txt
@@ -9,6 +9,7 @@ set(BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
 if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71)
     # Consume shared libraries and headers from prefabs
     find_package(ReactAndroid REQUIRED CONFIG)
+    find_package(fbjni REQUIRED CONFIG)  # Add this line to find fbjni

     include_directories(
         ${PACKAGE_NAME}
@@ -49,7 +50,17 @@ if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71)

     find_package(openssl REQUIRED CONFIG)

-    target_link_libraries(
+    if (REACTNATIVE_MERGED_SO OR ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
+     target_link_libraries(
+        ${PACKAGE_NAME}
+        ${LOG_LIB}
+        ReactAndroid::reactnative
+        ReactAndroid::jsi
+        fbjni::fbjni
+        openssl::crypto
+      )
+    else()
+      target_link_libraries(
         ${PACKAGE_NAME}
         ${LOG_LIB}
         ReactAndroid::jsi
@@ -57,7 +68,8 @@ if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71)
         ReactAndroid::react_nativemodule_core
         android
         openssl::crypto
-    )
+     )
+    endif()
 else()
     add_library(
         ${PACKAGE_NAME}

@ngocle2497
Copy link
Collaborator

ngocle2497 commented Jul 27, 2025

Implemented in PR

@ngocle2497 ngocle2497 closed this Jul 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants