Android.mk文件中添加第三方jar文件

2018-01-10  本文已影响0人  留给时光吧

先添加:

LOCAL_STATIC_JAVA_LIBRARIES += clib    

clib为库名,可任意命名
然后下面语句中间添加
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES :=clib:libs/clib.jar

include $(CLEAR_VARS)
include $(BUILD_MULTI_PREBUILT)

即:

include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := clib:libs/clib.jar          
include $(BUILD_MULTI_PREBUILT)

libs/clib.jar代表:文件夹/文件名,前面的clib要与上面指定的库名一致
如果有多个jar文件,可以这样

LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := clib:libs/clib.jar \
                    mygson:libs/mygson.jar 
上一篇 下一篇

猜你喜欢

热点阅读