Solve the problem that the android jni project will delete other so files
During Android project development, jni is used in the project, and C/C ++ is used to write its own so library. debugging and running are all normal. The Android. mk file code is as follows:
LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE:=observerLOCAL_SRC_FILES:=observer.cLOCAL_C_INCLUDES:= $(LOCAL_PATH)/includeLOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -lloginclude $(BUILD_SHARED_LIBRARY)
If we need to introduce other third-party so libraries to libs/armeabi, we will find that the third-party so library we just joined has been deleted during project compilation and running.
In this case, you only need to adjust it as follows:
1. Create the directory "prebuilt" in jni (other names can also be called)
2. Modify the Android. mk file and add our third-party so library to it. The added content of Android. mk on me is as follows:
LOCAL_PATH := $(call my-dir)include $(CLEAR_VARS)LOCAL_MODULE := tpnsSecurityLOCAL_SRC_FILES := prebuilt/libtpnsSecurity.soinclude $(PREBUILT_SHARED_LIBRARY)include $(CLEAR_VARS)LOCAL_MODULE := tpnsWatchdogLOCAL_SRC_FILES := prebuilt/libtpnsWatchdog.soinclude $(PREBUILT_SHARED_LIBRARY)include $(CLEAR_VARS)LOCAL_MODULE:=observerLOCAL_SRC_FILES:=observer.cLOCAL_C_INCLUDES:= $(LOCAL_PATH)/includeLOCAL_LDLIBS += -L$(SYSROOT)/usr/lib -lloginclude $(BUILD_SHARED_LIBRARY)