1

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.

Compile ERROR Message

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 inside main/jniLibs, and still didn't work.

  • I put the .so files inside app/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:

Project structure

I really need help.

Tsyvarev
  • 60,011
  • 17
  • 110
  • 153
fadi
  • 11
  • 4
  • It is preferable to place code and errors as text over images they can be copy and pasted. – nerdlyist Nov 21 '16 at 18:27
  • See if this helps: http://stackoverflow.com/a/38477333/2979092 It can be fiddly and it is hard trying to find the right information about how it is done. – WLGfx Nov 22 '16 at 08:40
  • Thanks everyone, I have already solved this problem by setting the IMPORTED_LOCATION to C:/......./src/main/jniLibs/armeabi-v7a/libavformat-55.so – fadi Nov 24 '16 at 02:29

0 Answers0