I am using a native library that includes opencv. The library builds well and works well in all devices and emulators, but not on Android 4.2 ones. It crashes on System.loadLibrary("mylib");
.
The library is built for armeabi-v7a armeabi x86 mips (I see in the jnilibs folder that all the so files were generated)
I am stuck on this bug because I couldn't find any answer on the internet which could explain my problem.
Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libopencv_java.so"
, log trace:
1755-1755/com.ex.app E/AndroidRuntime: FATAL EXCEPTION: main java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libopencv_java.so" needed by "libmylib.so"; caused by load_library(linker.cpp:745): library "libopencv_java.so" not found at java.lang.Runtime.loadLibrary(Runtime.java:371) at java.lang.System.loadLibrary(System.java:535) at com.ex.app.core.MyApplication.initVippAsync(MyApplication.java:198) at com.ex.app.core.MyApplication.onCreate(MyApplication.java:100) at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1000) at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4391) at android.app.ActivityThread.access$1300(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5039) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) at dalvik.system.NativeStart.main(Native Method)
Android.mk:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) OPENCV_INSTALL_MODULES:=on include /Users/ahmed/Documents/openCv4android/OpenCV-2.4.10-android-sdk/sdk/native/jni/OpenCV.mk LOCAL_MODULE := mylib LOCAL_LDLIBS += -llog -ldl LOCAL_SRC_FILES := myFile.c include $(BUILD_SHARED_LIBRARY)
Application.mk:
APP_ABI := armeabi-v7a armeabi x86 mips APP_PLATFORM := android-16