Android JNI原生库未打包到apk

时间:2018-04-12 02:43:37

标签: android java-native-interface

将我的项目从eclipse转换为AS。 我得到了一个致命的错误,这个错误是由“未找到lib”问题造成的。

我的项目包含jni代码,由ndk构建系统编译并由“Android.mk”文件管理。

转换后,我发现两个库(.so)打包到apk文件中,而其他库被正确打包。

以下是“Android.mk”文件内容的一部分,所有库都打包了但是“curl”和“jsqlite”。这两个文件确实存在于正确的路径中。有任何建议,请问!!

LOCAL_PATH := $(call my-dir)
MY_LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_MODULE    := skia
LOCAL_SRC_FILES :=  libs/$(TARGET_ARCH_ABI)/libskia.a
include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := iconv
LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libiconv.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_EXPORT_LDLIBS :=
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := jsqlite
LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libjsqlite.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_EXPORT_LDLIBS := -lz
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE := curl
LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libcurl.so
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_EXPORT_LDLIBS :=
include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)
LOCAL_MODULE    := gdal
LOCAL_SRC_FILES := libs/$(TARGET_ARCH_ABI)/libgdal.so
LOCAL_SHARED_LIBRARIES := jsqlite
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_EXPORT_LDLIBS := -lz
include $(PREBUILT_SHARED_LIBRARY)

0 个答案:

没有答案