From fc43b1bb7ccd1cb4d35783b50e95e2a4711af858 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Thu, 7 Oct 2021 11:16:19 +0200 Subject: [PATCH] fix: Avoid duplicate C++ symbols by using `libjsi.so` shared library (#494) * fix: Avoid duplicate C++ symbols by using `libjsi.so` shared library * exclude `libfbjni` and `libjsi` from packaging options --- android/CMakeLists.txt | 25 ++++++++++++++++--------- android/build.gradle | 2 +- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/android/CMakeLists.txt b/android/CMakeLists.txt index 1fb1ad1..ab15dc3 100644 --- a/android/CMakeLists.txt +++ b/android/CMakeLists.txt @@ -81,11 +81,6 @@ else() file (GLOB LIBREANIMATED_DIR "${BUILD_DIR}/react-native-reanimated-*-jsc.aar/jni/${ANDROID_ABI}") endif() - -find_library( - LOG_LIB - log -) find_library( FBJNI_LIB fbjni @@ -93,12 +88,11 @@ find_library( NO_CMAKE_FIND_ROOT_PATH ) find_library( - REANIMATED_LIB - reanimated - PATHS ${LIBREANIMATED_DIR} + JSI_LIB + jsi + PATHS ${LIBRN_DIR} NO_CMAKE_FIND_ROOT_PATH ) - find_library( FOLLY_JSON_LIB folly_json @@ -113,12 +107,25 @@ find_library( NO_CMAKE_FIND_ROOT_PATH ) +find_library( + REANIMATED_LIB + reanimated + PATHS ${LIBREANIMATED_DIR} + NO_CMAKE_FIND_ROOT_PATH +) + +find_library( + LOG_LIB + log +) + # linking message(WARNING "VisionCamera linking: FOR_HERMES=${FOR_HERMES}") target_link_libraries( ${PACKAGE_NAME} ${LOG_LIB} + ${JSI_LIB} ${JS_ENGINE_LIB} # <-- Hermes or JSC ${REANIMATED_LIB} ${REACT_NATIVE_JNI_LIB} diff --git a/android/build.gradle b/android/build.gradle index ddd651c..17a55b9 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -112,7 +112,7 @@ android { } packagingOptions { - excludes = ["**/libc++_shared.so", "**/libfbjni.so"] + excludes = ["**/libc++_shared.so", "**/libfbjni.so", "**/libjsi.so"] } buildTypes {