To introduce my problem, I have an application using NDK compiled only for "armeabi-v7a" and "x86" ABIs. So compilation gives me:
Android NDK: WARNING: APP_PLATFORM android-17 is larger than android:minSdkVersion 10 in /home/**********/AndroidManifest.xml
[armeabi-v7a] Gdbserver : [arm-linux-androideabi-4.9] libs/armeabi-v7a/gdbserver
[armeabi-v7a] Gdbsetup : libs/armeabi-v7a/gdb.setup
[x86] Gdbserver : [x86-4.9] libs/x86/gdbserver
[x86] Gdbsetup : libs/x86/gdb.setup
[armeabi-v7a] Install : libNativeFFMPEG.so => libs/armeabi-v7a/libNativeFFMPEG.so
[armeabi-v7a] Install : libavcodec-56.so => libs/armeabi-v7a/libavcodec-56.so
[armeabi-v7a] Install : libavutil-54.so => libs/armeabi-v7a/libavutil-54.so
[armeabi-v7a] Install : libswscale-3.so => libs/armeabi-v7a/libswscale-3.so
[x86] Install : libNativeFFMPEG.so => libs/x86/libNativeFFMPEG.so
[x86] Install : libavcodec-57.so => libs/x86/libavcodec-57.so
[x86] Install : libavutil-55.so => libs/x86/libavutil-55.so
[x86] Install : libswscale-4.so => libs/x86/libswscale-4.so
My problem is maybe indicated by this warning? (This is not the same ffmpeg library version on the two target ABIs but I don't think it is the problem)
Then, I create an emulator with CPU/ABI = (ARM) armeabi-v7a and my lib is not loaded when the application started (but with an "x86" based device, "x86" lib is loaded and works). When I explore it (the emulator) with a shell, I can see that:
lrwxrwxrwx install 2016-07-20 10:06 lib -> /data/app/com.**********/lib/x86
Only "x86" lib is installed... Explanations please?
(I have the same problem testing on a Samsung Galaxy S3, the CPU should be a ARM Cortex-A9 and this CPU implements ARMv7-A architecture. But my library is not find either...)
&&&&&&&&&&&&&& AFTER SOME MANIP I FIX ERROR IN ANDROID.MK &&&&&&&&&&&&&&
If you're interested by exception generated when I call System.loadLibrary(), this is following:
07-20 12:31:23.360: D/dalvikvm(3671): Trying to load lib /data/app-lib/com.**********/libNativeFFMPEG.so 0x40cdc118
07-20 12:31:23.370: W/System.err(3671): java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libswscale-3.so" needed by "libNativeFFMPEG.so"; caused by load_library(linker.cpp:745): library "libswscale-3.so" not found
07-20 12:31:23.370: W/System.err(3671): at java.lang.Runtime.loadLibrary(Runtime.java:371)
...
But when I look into /data/app-lib/com.**********, I find my "armeabi-v7a" libs!!
root@android:/data/app-lib/com.********** # ls
gdbserver
libNativeFFMPEG.so
libavcodec-56.so
libavutil-54.so
libswscale-3.so
But it still the exception! When I try to load swscale like System.loadLibrary("swscale-3"); I've got following exception:
07-20 12:56:36.351: E/dalvikvm(4174): dlopen("/data/app-lib/com.**********/libswscale-3.so") failed: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libavutil-54.so" needed by "libswscale-3.so"; caused by load_library(linker.cpp:745): library "libavutil-54.so" not found
07-20 12:56:36.361: W/System.err(4174): java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libavutil-54.so" needed by "libswscale-3.so"; caused by load_library(linker.cpp:745): library "libavutil-54.so" not found
07-20 12:56:36.361: W/System.err(4174): java.lang.UnsatisfiedLinkError: Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "libavutil-54.so" needed by "libswscale-3.so"; caused by load_library(linker.cpp:745): library "libavutil-54.so" not found
And when I try the same to load avutil-54, I have the same exception of "NativeFFMPEG" (but with libavutil-54.so)