From 81fa9b104843a31d35c780f188244454f93bbe48 Mon Sep 17 00:00:00 2001 From: Oscar Franco Date: Sat, 26 Oct 2024 11:43:38 +0200 Subject: [PATCH] Fix build --- android/CMakeLists.txt | 91 ++++++++++++++++++++++++++++-------------- android/build.gradle | 2 +- 2 files changed, 63 insertions(+), 30 deletions(-) diff --git a/android/CMakeLists.txt b/android/CMakeLists.txt index eace805e..5ff0655d 100644 --- a/android/CMakeLists.txt +++ b/android/CMakeLists.txt @@ -73,39 +73,72 @@ find_package(fbjni REQUIRED CONFIG) find_library(LOG_LIB log) if (USE_SQLCIPHER) - target_link_libraries( - ${PACKAGE_NAME} - ${LOG_LIB} - fbjni::fbjni - ReactAndroid::jsi - ReactAndroid::turbomodulejsijni - ReactAndroid::react_nativemodule_core - android - openssl::crypto - ) + if (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} + fbjni::fbjni + ReactAndroid::jsi + ReactAndroid::turbomodulejsijni + ReactAndroid::react_nativemodule_core + android + openssl::crypto + ) + endif() elseif (USE_LIBSQL) cmake_path(SET LIBSQL ${CMAKE_CURRENT_SOURCE_DIR}/jniLibs/${ANDROID_ABI}/libsql_experimental.a NORMALIZE) add_library(libsql STATIC IMPORTED) set_target_properties(libsql PROPERTIES IMPORTED_LOCATION ${LIBSQL}) - target_link_libraries( - ${PACKAGE_NAME} - ${LOG_LIB} - fbjni::fbjni - ReactAndroid::jsi - ReactAndroid::turbomodulejsijni - ReactAndroid::react_nativemodule_core - android - libsql - ) + if (ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) + target_link_libraries( + ${PACKAGE_NAME} + ${LOG_LIB} + ReactAndroid::reactnative + ReactAndroid::jsi + fbjni::fbjni + libsql + ) + else() + target_link_libraries( + ${PACKAGE_NAME} + ${LOG_LIB} + fbjni::fbjni + ReactAndroid::jsi + ReactAndroid::turbomodulejsijni + ReactAndroid::react_nativemodule_core + android + libsql + ) + endif() else () - target_link_libraries( - ${PACKAGE_NAME} - ${LOG_LIB} - fbjni::fbjni - ReactAndroid::jsi - ReactAndroid::turbomodulejsijni - ReactAndroid::react_nativemodule_core - android - ) + # if (REACTNATIVE_MERGED_SO) + if (ReactAndroid_VERSION_MINOR GREATER_EQUAL 76) + target_link_libraries( + ${PACKAGE_NAME} + ${LOG_LIB} + ReactAndroid::reactnative + ReactAndroid::jsi + fbjni::fbjni + ) + else() + target_link_libraries( + ${PACKAGE_NAME} + ${LOG_LIB} + fbjni::fbjni + ReactAndroid::jsi + ReactAndroid::turbomodulejsijni + ReactAndroid::react_nativemodule_core + android + ) + endif() endif() \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 97870266..1ac67529 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -112,7 +112,7 @@ android { defaultConfig { minSdkVersion safeExtGet("minSdkVersion", 24) - targetSdkVersion safeExtGet('targetSdkVersion', 34) + targetSdkVersion safeExtGet('targetSdkVersion', 35) versionCode 1 versionName "1.0"