diff --git a/ReactAndroid/Android-prebuilt.mk b/ReactAndroid/Android-prebuilt.mk index a1c4d31ab0c..42cb5b08232 100644 --- a/ReactAndroid/Android-prebuilt.mk +++ b/ReactAndroid/Android-prebuilt.mk @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -# This configuration provides access to most common React Native prebuilt .so and .a files +# This configuration provides access to most common React Native prebuilt .so files # to avoid recompiling each of the libraries outside of ReactAndroid NDK compilation. # Hosting app's/library's Android.mk can include this Android-prebuilt.mk file to # get access to those libraries to depend on. @@ -19,7 +19,7 @@ THIRD_PARTY_NDK_DIR := $(REACT_ANDROID_BUILD_DIR)/third-party-ndk REACT_ANDROID_SRC_DIR := $(REACT_ANDROID_DIR)/src/main REACT_COMMON_DIR := $(REACT_ANDROID_DIR)/../ReactCommon REACT_GENERATED_SRC_DIR := $(REACT_ANDROID_BUILD_DIR)/generated/source -# Note: this have both .so and .a files +# Note: this have only .so files REACT_NDK_EXPORT_DIR := $(PROJECT_BUILD_DIR)/react-ndk/exported # fb @@ -197,15 +197,13 @@ LOCAL_EXPORT_C_INCLUDES := \ $(REACT_GENERATED_SRC_DIR)/codegen/jni include $(PREBUILT_SHARED_LIBRARY) -# fbjni -include $(FIRST_PARTY_NDK_DIR)/fbjni/Android.mk - -#### Static Libraries - # runtimeexecutor include $(CLEAR_VARS) LOCAL_MODULE := runtimeexecutor -LOCAL_SRC_FILES := $(REACT_NDK_EXPORT_DIR)/$(TARGET_ARCH_ABI)/libruntimeexecutor.a +LOCAL_SRC_FILES := $(REACT_NDK_EXPORT_DIR)/$(TARGET_ARCH_ABI)/libruntimeexecutor.so LOCAL_C_INCLUDES := $(REACT_COMMON_DIR)/runtimeexecutor LOCAL_EXPORT_C_INCLUDES := $(REACT_COMMON_DIR)/runtimeexecutor -include $(PREBUILT_STATIC_LIBRARY) +include $(PREBUILT_SHARED_LIBRARY) + +# fbjni +include $(FIRST_PARTY_NDK_DIR)/fbjni/Android.mk diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index e6dc6ffe970..1ce9cce1597 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -238,10 +238,6 @@ tasks.register("packageReactNdkLibsForBuck") { tasks.register("packageReactNdkDebugLibsForBuck", Copy) { dependsOn("mergeDebugNativeLibs") - // Static libraries (.a) are copied from the obj/local folder - from("$buildDir/intermediates/ndkBuild/debug/obj/local/") { - include '**/*.a' - } // Shared libraries (.so) are copied from the merged_native_libs folder instead from("$buildDir/intermediates/merged_native_libs/debug/out/lib/") exclude("**/libjsc.so") @@ -251,10 +247,6 @@ tasks.register("packageReactNdkDebugLibsForBuck", Copy) { tasks.register("packageReactNdkReleaseLibsForBuck", Copy) { dependsOn("mergeReleaseNativeLibs") - // Static libraries (.a) are copied from the obj/local folder - from("$buildDir/intermediates/ndkBuild/debug/obj/local/") { - include '**/*.a' - } // Shared libraries (.so) are copied from the merged_native_libs folder instead from("$buildDir/intermediates/merged_native_libs/release/out/lib/") exclude("**/libjsc.so") diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/Android.mk b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/Android.mk index b017546b19d..baa71603e64 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/Android.mk +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/Android.mk @@ -19,9 +19,9 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall -LOCAL_SHARED_LIBRARIES = libfb libfbjni libreactnativeutilsjni +LOCAL_SHARED_LIBRARIES = libfb libfbjni libreactnativeutilsjni libruntimeexecutor -LOCAL_STATIC_LIBRARIES = libcallinvoker libreactperfloggerjni libruntimeexecutor +LOCAL_STATIC_LIBRARIES = libcallinvoker libreactperfloggerjni # Name of this module. LOCAL_MODULE := callinvokerholder diff --git a/ReactAndroid/src/main/jni/react/jni/Android.mk b/ReactAndroid/src/main/jni/react/jni/Android.mk index 46548e2537d..5faf3fac960 100644 --- a/ReactAndroid/src/main/jni/react/jni/Android.mk +++ b/ReactAndroid/src/main/jni/react/jni/Android.mk @@ -27,10 +27,10 @@ LOCAL_CFLAGS += -fexceptions -frtti -Wno-unused-lambda-capture LOCAL_LDLIBS += -landroid # The dynamic libraries (.so files) that this module depends on. -LOCAL_SHARED_LIBRARIES := libfolly_json libfb libfbjni libglog_init libyoga libreact_render_runtimescheduler +LOCAL_SHARED_LIBRARIES := libfolly_json libfb libfbjni libglog_init libyoga libreact_render_runtimescheduler libruntimeexecutor # The static libraries (.a files) that this module depends on. -LOCAL_STATIC_LIBRARIES := libreactnative libcallinvokerholder libruntimeexecutor +LOCAL_STATIC_LIBRARIES := libreactnative libcallinvokerholder # Name of this module. # @@ -77,10 +77,10 @@ LOCAL_CFLAGS += -fexceptions -frtti -Wno-unused-lambda-capture LOCAL_LDLIBS += -landroid # The dynamic libraries (.so files) that this module depends on. -LOCAL_SHARED_LIBRARIES := libreactnativeutilsjni libfolly_json libfb libfbjni libglog_init libyoga logger libreact_render_runtimescheduler +LOCAL_SHARED_LIBRARIES := libreactnativeutilsjni libfolly_json libfb libfbjni libglog_init libyoga logger libreact_render_runtimescheduler libruntimeexecutor # The static libraries (.a files) that this module depends on. -LOCAL_STATIC_LIBRARIES := libreactnative libruntimeexecutor libcallinvokerholder +LOCAL_STATIC_LIBRARIES := libreactnative libcallinvokerholder # Name of this module. # diff --git a/ReactCommon/cxxreact/Android.mk b/ReactCommon/cxxreact/Android.mk index 392c33b730a..88889238e72 100644 --- a/ReactCommon/cxxreact/Android.mk +++ b/ReactCommon/cxxreact/Android.mk @@ -19,8 +19,8 @@ LOCAL_CFLAGS := \ LOCAL_CFLAGS += -fexceptions -frtti -Wno-unused-lambda-capture -LOCAL_STATIC_LIBRARIES := boost jsi callinvoker reactperflogger runtimeexecutor -LOCAL_SHARED_LIBRARIES := jsinspector libfolly_json glog logger +LOCAL_STATIC_LIBRARIES := boost jsi callinvoker reactperflogger +LOCAL_SHARED_LIBRARIES := jsinspector libfolly_json glog logger libruntimeexecutor include $(BUILD_STATIC_LIBRARY) diff --git a/ReactCommon/runtimeexecutor/Android.mk b/ReactCommon/runtimeexecutor/Android.mk index 6b39530804d..46a04d85c95 100644 --- a/ReactCommon/runtimeexecutor/Android.mk +++ b/ReactCommon/runtimeexecutor/Android.mk @@ -16,4 +16,4 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall -include $(BUILD_STATIC_LIBRARY) +include $(BUILD_SHARED_LIBRARY) diff --git a/packages/rn-tester/android/app/src/main/jni/Android.mk b/packages/rn-tester/android/app/src/main/jni/Android.mk index b8d1baec531..ec3279086cb 100644 --- a/packages/rn-tester/android/app/src/main/jni/Android.mk +++ b/packages/rn-tester/android/app/src/main/jni/Android.mk @@ -19,8 +19,8 @@ LOCAL_MODULE := rntester_appmodules LOCAL_C_INCLUDES := $(LOCAL_PATH) $(GENERATED_SRC_DIR)/codegen/jni LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp) LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) $(GENERATED_SRC_DIR)/codegen/jni -LOCAL_SHARED_LIBRARIES := libfbjni libglog libfolly_json libfolly_futures libyoga libreact_nativemodule_core libturbomodulejsijni librrc_view libreact_render_core libreact_render_graphics libreact_codegen_rncore libfabricjni libreact_render_componentregistry libreact_debug libreact_render_debug libreact_codegen_rntester -LOCAL_STATIC_LIBRARIES := libsampleturbomodule libruntimeexecutor +LOCAL_SHARED_LIBRARIES := libfbjni libglog libfolly_json libfolly_futures libyoga libreact_nativemodule_core libturbomodulejsijni librrc_view libreact_render_core libreact_render_graphics libreact_codegen_rncore libfabricjni libreact_render_componentregistry libruntimeexecutor libreact_debug libreact_render_debug libreact_codegen_rntester +LOCAL_STATIC_LIBRARIES := libsampleturbomodule LOCAL_CFLAGS := \ -DLOG_TAG=\"ReactNative\"