Android : link prebuilt shared library (.so) within jar file in NDK

ぐ巨炮叔叔 提交于 2019-12-01 09:30:36

问题


I've a static java library compiled as a jar file. This jar loads a .so library using System.loadLibrary. Then another Android application project links statically the jar file.

Everything is compiled using an Android.mk file in the NDK...how can I make the shared native library being included and correctly loaded from my final application (and "seen" from the jar code)?


回答1:


Ok I solved the problem by using these instructions in Android.mk:

$(shell cp $(wildcard $(LOCAL_PATH)/libs/armeabi/*.so) $(TARGET_OUT_INTERMEDIATE_LIBRARIES)) LOCAL_JNI_SHARED_LIBRARIES:= libMyLib

just before

include $(BUILD_PACKAGE)



来源:https://stackoverflow.com/questions/14322766/android-link-prebuilt-shared-library-so-within-jar-file-in-ndk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!