Friday, April 20, 2012

SharedLib dependency @ Mixed mode APK


  1. I am building a mixed mode Android project, the project is using the native ffmpeg

  2. The Libs are

    2.1. libavutil.so -> libavutil.so.51

    2.2. libavcodec.so -> libavcodec.so.54

    2.3. libavformat.so -> libavformat.so.54

  3. My Java code include the following JNI section to load the native libs:

    static {

         System.loadLibrary("avutil");

         System.loadLibrary("avcodec");

         System.loadLibrary("avformat");

    }

  4. 'libavcodec.so' depends on 'libavutil.so.51' AND NOT on 'libavutil.so'.

  5. When running my activity  System.loadLibrary("avcodec"); excepts with "could not load needed library 'libavutil.so.51' for 'libavcodec.so' (Library 'libavutil.so.51' not found)"

  6. On my Android.mk I have the following section to have the native libs added to the APK:



    include $(CLEAR_VARS)

    LOCAL_MODULE := mylib

    LOCAL_SRC_FILES := ../../../Android/ffmpeg/libavcodec/libmylib.so

    include $(PREBUILT_SHARED_LIBRARY)



  7. replacing libmylib.so with libmylib.so. cause the build to fail with [LOCAL_SRC_FILES should point to a file ending with ".so"]





    Having the above in mind, how can have libavcodec loading w/o the dependency problem ?


    • Can I fix libavcodec.so dependency to point to libavutil.so and not to libavutil.so.51 ?

    • Can I change Android.mk so it will be able to pack libavutil.so.51 ( non .SO extention ).



      Any help will be appreciated!!!



      Nadav at Sophin






No comments:

Post a Comment