I am having a problem with stlport binding to gradle project in Android Studio.
The Eclipse Android project using the NDK is ported to Android Studio.
The project uses STL, and I have an android.mk file with the contents
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := MyProject LOCAL_SRC_FILES := jniapi.cpp renderer.cpp LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM -ljnigraphics include $(BUILD_SHARED_LIBRARY)
Gradle seems to ignore the .mk file, and I added the following code to the build.gradle file:
ndk { moduleName "MyProject" stl "stlport_shared" ldLibs "log", "EGL", "android", "jnigraphics", "GLESv1_CM" //No equivalent for the "include $(BUILD_SHARED_LIBRARY)" here }
After that, the gradle building became successful, but running the application on the device causes an error:
27446-27446/com.example.test E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libstlport_shared.so" needed by "libMyProject.so"; caused by load_library(linker.cpp:745): library "libstlport_shared.so" not found
source share