couldn't find "libxxx.so"和 Android 8.1 预置32位so库

第一步:

Android studio添加第三方库和so

https://blog.csdn.net/anhenzhufeng/article/details/78913341

 

在工程的build.gradle下如下

defaultConfig {
     ndk {
            abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
        }
}

然后在工程根目录下的gradle.properties文件中加入:
android.useDeprecatedNdk=true

https://www.jianshu.com/p/c89a72e8f257

第二步:

方法a:

在要使用的APK中显性引入so库:


 LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := TestIME
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := ./target/FuxiIMECID.apk
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_CERTIFICATE := PRESIGNED
LOCAL_MULTILIB := 32
LOCAL_PREBUILT_JNI_LIBS := \
    @lib/armeabi/libBDVoiceRecognitionClient_V1.so \
    @lib/armeabi/libchiperencoder_v1_2_1.so \
    @lib/armeabi/librabjni-1.so \
    @lib/armeabi/libshare_v2.so
include $(BUILD_PREBUILT)

https://blog.csdn.net/niotong2014/article/details/80461980

方法b:

1)采用prebuilt 的方式,在当前so 所在目录下写 Android.mk ,内容类似如下:

PREBUILT_PATH := $(call my-dir)

LOCAL_PATH          := $(PREBUILT_PATH)
include $(CLEAR_VARS)
LOCAL_MODULE        := libfxEngineHw
LOCAL_MODULE_CLASS  := SHARED_LIBRARIES
LOCAL_STRIP_MODULE  := false
LOCAL_MULTILIB      := 32
LOCAL_MODULE_OWNER  := fuxi
LOCAL_MODULE_TAGS   := optional
ALL_DEFAULT_INSTALLED_MODULES += $(LOCAL_MODULE)_32
LOCAL_MODULE_SUFFIX := $(TARGET_SHLIB_SUFFIX)
LOCAL_SRC_FILES := $(LOCAL_MODULE)$(TARGET_SHLIB_SUFFIX)
include $(BUILD_PREBUILT)

 

2)在引入的apk中声明如下

include $(CLEAR_VARS)
LOCAL_MODULE        := FuxiIMERSER
LOCAL_DEX_PREOPT    := $($(LOCAL_MODULE)_DEX_PEROPT)
LOCAL_MODULE_TAGS   := optional
LOCAL_MODULE_CLASS  := APPS
LOCAL_CERTIFICATE   := platform
LOCAL_MODULE_SUFFIX := .apk
LOCAL_SRC_FILES     := ./target/FuxiIMERSER.apk
LOCAL_JNI_SHARED_LIBRARIES := libfxEngineHw
include $(BUILD_PREBUILT)

include $(call all-makefiles-under,$(LOCAL_PATH))

https://www.jianshu.com/p/0ff1552f2323

 

 

 

你可能感兴趣的:(couldn't find "libxxx.so"和 Android 8.1 预置32位so库)