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)?
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