I am defining Application.开发者_Go百科mk APP_STL := stlport_shared
When I run ndk-build which in turn producing file: stlport_shared.so in obj/local/armeabi/ but it is not copying this file to libs/armeabi/ Because of which it doesn't get copied to the device and System.loadLibrary() throws UnsatisfiedLinkError.
Can anyone help?
It should be mentioned in the Application.mk as: APP_MODULES := stlport_shared.so other_dependent.so
In ordered to be copied to the device.
I believe you need to include something like following in your Android.mk file:
include $(CLEAR_VARS)
LOCAL_MODULE := stlport_shared
LOCAL_SRC_FILES := stlport_shared.so
include $(PREBUILT_SHARED_LIBRARY)
I had to add a line to my java file to load it:
System.loadLibrary("stlport_shared");
System.loadLibrary("my_lib");
As Nishant said, you need to use:
APP_STL := stlport_shared
APP_MODULES := stlport_shared mymodule ...
APP_STL
ensures use of STLport, while APP_MODULES
ensures its copied where needed.
Its a bug that stlport_shared
is not copied as needed. See Android Issue 21180: APP_STL := stlport_shared doesn't install libstlport_shared.so into libs directory. It should be fixed in NDK R7b.
精彩评论