I am really stuck and desperate for an answer. I have looked pretty much everywhere online to solve this problem with no real success.
Basically I have compiled ffmpeg for android and I am trying to use the (.so
) files inside Android Studio 2.2.2.
The problem is that I keep getting this error when I try to compile my code Please note that my code worked perfectly under MS Visual Studio and I am certain it works as it should.
I am thinking this error means that I am not linking my shared libraries (.so
) files against my .cpp
file (correct me if I am wrong).
Things I tried:
I have tried including my
.so
files insidemain/jniLibs
, and still didn't work.I put the
.so
files insideapp/libs
, and still no success.Provided linking rules in cmake for example:
add_library(B SHARED IMPORTED) set_target_properties(B PROPERTIES IMPORTED_LOCATION src/main/jniLibs/armeabi-v7a/libavformat-55.so ) include_directories(src/main/cpp/include/) target_link_libraries(native-lib B)
This gave me another error which looks like this:
Error:error: 'src/main/jniLibs/armeabi-v7a/libavformat-55.so', needed by '../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libnative-lib.so', missing and no known rule to make it
Here is the structure of my project tree:
I really need help.