Adding a external jar reference in Android.mk

前端 未结 5 1968
北恋
北恋 2021-02-01 10:56

I want to add a external third party jar file in the inbuilt android app.

I\'ve added the LOCAL_CLASSPATH variable in Android.mk due to which the compilation goes fine.

5条回答
  •  既然无缘
    2021-02-01 11:30

    An example is more than just talking.

    ...
    
    LOCAL_STATIC_JAVA_LIBRARIES := libmylibs
    
    LOCAL_PACKAGE_NAME := myapp
    
    ...
    
    include $(BUILD_PACKAGE)
    
    ##################################################
    include $(CLEAR_VARS)
    
    LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := libmylibs:mylib.jar
    
    include $(BUILD_MULTI_PREBUILT)
    

    Note: put the "mylib.jar" at the project root.

提交回复
热议问题