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

先添加:

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 

你可能感兴趣的:(Android.mk文件中添加第三方jar文件)