Shared Library not found error on android LogCat

2019-08-05 15:58发布

问题:

I'm trying to develop android app which can stream images from the camera to a server. So I've found a project that stream to the browser and you can find here: http://code.google.com/p/ipcamera-for-android/

I'm trying to run this code, but I get an error:

06-28 12:43:47.030: E/AndroidRuntime(31749): java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1963]: 1567 could not load needed library 'libffmpeg.so' for 'libipcamera.so' (load_library[1105]: Library 'libffmpeg.so' not found)

The part of the code where I load them:

public static void LoadLibraries() {
        System.loadLibrary("teaonly");      
        System.loadLibrary("ipcamera");     
    }

Here is the compiling native code image: (no errors)

http://i.imm.io/ujSE.png (since I'm new here, I can't post images)

and here is the Android.mk file:

#####################################################################
# the build script for NDK for droidipcam project
#

LOCAL_PATH:= $(call my-dir)

###########################################################
# the third prebuild library for linking
#
include $(CLEAR_VARS) 
LOCAL_MODULE := libffmpeg-prebuild  
LOCAL_SRC_FILES := libffmpeg.so
LOCAL_MODULE_TAGS := prebuild
include $(PREBUILT_SHARED_LIBRARY)

###########################################################
# build android libteaony 
# libteaonly: clone from libjingle, for generat NDK appplicaton
#      threads, socket, signal/slot and messages, etc.
#
include $(CLEAR_VARS)
LOCAL_MODULE := libteaonly
LOCAL_CPP_EXTENSION := .cc
LOCAL_CPPFLAGS := -O2 -Werror -Wall -DHAMMER_TIME=1 -DLOGGING=1 -DHASHNAMESPACE=__gnu_cxx -DHASH_NAMESPACE=__gnu_cxx -DPOSIX -DDISABLE_DYNAMIC_CAST -D_REENTRANT -DOS_LINUX=OS_LINUX -DLINUX -D_DEBUG  -DANDROID

#including source files
include $(LOCAL_PATH)/lib_build.mk

LOCAL_LDLIBS := -llog

include $(BUILD_SHARED_LIBRARY)

###########################################################
# the native jni interface library
#
include $(CLEAR_VARS)
LOCAL_MODULE    := ipcamera
LOCAL_CPPFLAGS := -O2 -Werror -Wall -DHAMMER_TIME=1 -DLOGGING=1 -DHASHNAMESPACE=__gnu_cxx -DHASH_NAMESPACE=__gnu_cxx -DPOSIX -DDISABLE_DYNAMIC_CAST -D_REENTRANT -DOS_LINUX=OS_LINUX -DLINUX -D_DEBUG  -DANDROID
LOCAL_C_INCLUDES :=  ./ $(LOCAL_PATH)/ffmpeg
LOCAL_SHARED_LIBRARIES := libffmpeg-prebuild libteaonly
LOCAL_LDLIBS := -llog

include $(LOCAL_PATH)/build.mk

include $(BUILD_SHARED_LIBRARY)

My questions are:

  • Do you guys know how to fix this error?
  • Is that possible to get an response (like the video processed) from the server? It would be like a p2p app.

回答1:

try to use

LOCAL_SHARED_LIBRARIES += libffmpeg-prebuild 

instead of

LOCAL_SHARED_LIBRARIES := libffmpeg-prebuild libteaonly

hope this will solve ur problem....