美文网首页
源码编译涉及到不存在的jar/aar/so文件配置mk文件

源码编译涉及到不存在的jar/aar/so文件配置mk文件

作者: WangRain1 | 来源:发表于2020-06-02 09:45 被阅读0次

    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

    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)

    https://www.cnblogs.com/l2rf/p/5973362.html

    相关文章

      网友评论

          本文标题:源码编译涉及到不存在的jar/aar/so文件配置mk文件

          本文链接:https://www.haomeiwen.com/subject/ukbyzhtx.html