1.使用的mk文件里面配置:LOCAL_STATIC_JAVA_LIBRARIES := abc/LOCAL_STATIC_JAVA_AAR_LIBRARIES += abc
集成aar文件mk:
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_JAVA_AAR_LIBRARIES := abc
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := abc:abc.aar /LOCAL_STATIC_JAVA_LIBRARIES
include $(BUILD_MULTI_PREBUILT)
2.加载.so文件
include $(CLEAR_VARS)
LOCAL_MODULE := Transport.so
LOCAL_MODULE_TAGS := eng optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)
LOCAL_SRC_FILES_arm := $(LOCAL_MODULE)
LOCAL_SRC_FILES_arm64 := $(LOCAL_MODULE)
LOCAL_PROPRIETARY_MODULE := true
LOCAL_MODULE_OWNER := 随便写(thundso)
LOCAL_MODULE_TARGET_ARCH := arm arm64
include $(BUILD_PREBUILT)
引用:
PRODUCT_PACKAGES+=Transport.so
3.编译好的apk 加载so
include $(CLEAR_VARS)
# Module name should match apk name to be installed
LOCAL_MODULE := Test
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_PREBUILT_JNI_LIBS := \
@lib/armeabi/libtest.so \
@lib/armeabi/libtest2.so
LOCAL_CERTIFICATE := PRESIGNED
include $(BUILD_PREBUILT)
网友评论