Skip to content
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

React native 0.76 #366

Closed
mahendihasan-impactguru opened this issue Oct 31, 2024 · 1 comment
Closed

React native 0.76 #366

mahendihasan-impactguru opened this issue Oct 31, 2024 · 1 comment

Comments

@mahendihasan-impactguru
Copy link

mahendihasan-impactguru commented Oct 31, 2024

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-mmkv-storage/android/src/main/rnmmkv/CMakeLists.txt b/node_modules/react-native-mmkv-storage/android/src/main/rnmmkv/CMakeLists.txt
index a61f56a..7341c12 100644
--- a/node_modules/react-native-mmkv-storage/android/src/main/rnmmkv/CMakeLists.txt
+++ b/node_modules/react-native-mmkv-storage/android/src/main/rnmmkv/CMakeLists.txt
@@ -25,13 +25,29 @@ find_package(ReactAndroid REQUIRED CONFIG)
 find_library(log-lib log)
 find_package(fbjni REQUIRED CONFIG)
 
-target_link_libraries(
-        ${PACKAGE_NAME}
-        core               
-        ${log-lib}
-        fbjni::fbjni
-        ReactAndroid::jsi
-        ReactAndroid::turbomodulejsijni
-        ReactAndroid::react_nativemodule_core
-        android
-)
+# Ideally we would just depend on `REACTNATIVE_MERGED_SO`
+# See https://github.com/react-native-community/discussions-and-proposals/discussions/816
+# For some reason (yet to be determined) we don't have REACTNATIVE_MERGED_SO set here.
+# See https://github.com/react-native-community/discussions-and-proposals/discussions/816#discussioncomment-10659654
+if (REACTNATIVE_MERGED_SO OR ReactAndroid_VERSION_MINOR GREATER_EQUAL 76)
+        target_link_libraries(
+                ${PACKAGE_NAME}
+                core               
+                ${log-lib}
+                fbjni::fbjni
+                ReactAndroid::jsi
+                ReactAndroid::reactnative
+                android
+        )
+else()
+        target_link_libraries(
+                ${PACKAGE_NAME}
+                core               
+                ${log-lib}
+                fbjni::fbjni
+                ReactAndroid::jsi
+                ReactAndroid::turbomodulejsijni
+                ReactAndroid::react_nativemodule_core
+                android
+        )
+endif()
@mahendihasan-impactguru
Copy link
Author

mahendihasan-impactguru commented Oct 31, 2024

closed because some one raise PR already

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

No branches or pull requests

1 participant