Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/212.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Gstreamer Ndk生成错误_Android_Android Ndk_Gstreamer - Fatal编程技术网

Android Gstreamer Ndk生成错误

Android Gstreamer Ndk生成错误,android,android-ndk,gstreamer,Android,Android Ndk,Gstreamer,我想在我的android手机上使用gstreamer,但我在运行ndk build时遇到了这些错误,尽管我已经阅读了add-pthread 任何人都知道如何解决这个问题,我在我的ubuntu电脑上构建了这个 Android.mk LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := test_lib LOCAL_SRC_FILES := test_gst.cpp LOCAL_SHARED_LIBRARIE

我想在我的android手机上使用gstreamer,但我在运行ndk build时遇到了这些错误,尽管我已经阅读了add-pthread

任何人都知道如何解决这个问题,我在我的ubuntu电脑上构建了这个

  • Android.mk

    LOCAL_PATH := $(call my-dir)
    
    include $(CLEAR_VARS)
    
    LOCAL_MODULE    := test_lib
    LOCAL_SRC_FILES := test_gst.cpp
    LOCAL_SHARED_LIBRARIES := gstreamer_android
    LOCAL_LDLIBS := -llog -landroid -pthread
    include $(BUILD_SHARED_LIBRARY)
    
    ifndef GSTREAMER_SDK_ROOT
    ifndef GSTREAMER_SDK_ROOT_ANDROID
    $(error GSTREAMER_SDK_ROOT_ANDROID is not defined!)
    endif
    GSTREAMER_ROOT        := $(GSTREAMER_SDK_ROOT_ANDROID)
    endif
    GSTREAMER_NDK_BUILD_PATH  := $(GSTREAMER_ROOT)/share/gst-android/ndk-build
    
    include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk
    
  • 错误

    The list of GSTREAMER_PLUGINS is empty"
    GStreamer      : [GEN] => gst-build-armeabi-v7a/gstreamer_android.c
    GStreamer      : [COMPILE] => gst-build-armeabi-v7a/gstreamer_android.c
    GStreamer      : [LINK] => gst-build-armeabi-v7a/libgstreamer_android.so
    gstinfo.c:1885: error: undefined reference to 'dladdr'
    gwakeup.c:146: error: undefined reference to 'eventfd'
    glib-unix.c:98: error: undefined reference to 'pipe2'
    gthread-posix.c:444: error: undefined reference to 'pthread_rwlock_init'
    gthread-posix.c:453: error: undefined reference to 'pthread_rwlock_destroy'
    gthread-posix.c:652: error: undefined reference to 'pthread_condattr_init'
    gthread-posix.c:669: error: undefined reference to 'pthread_condattr_destroy'
    gthread-posix.c:453: error: undefined reference to 'pthread_rwlock_destroy'
    gthread-posix.c:543: error: undefined reference to 'pthread_rwlock_wrlock'
    gthread-posix.c:561: error: undefined reference to 'pthread_rwlock_trywrlock'
    gthread-posix.c:581: error: undefined reference to 'pthread_rwlock_unlock'
    gthread-posix.c:600: error: undefined reference to 'pthread_rwlock_rdlock'
    gthread-posix.c:618: error: undefined reference to 'pthread_rwlock_tryrdlock'
    gthread-posix.c:638: error: undefined reference to 'pthread_rwlock_unlock'
    ./bindtextdom.c:312: error: undefined reference to 'pthread_rwlock_unlock'
    ./bindtextdom.c:91: error: undefined reference to 'pthread_rwlock_wrlock'
    ./bindtextdom.c:91: error: undefined reference to 'pthread_rwlock_wrlock'
    ./loadmsgcat.c:1287: error: undefined reference to 'pthread_rwlock_init'
    ./textdomain.c:73: error: undefined reference to 'pthread_rwlock_wrlock'
    ./textdomain.c:117: error: undefined reference to 'pthread_rwlock_unlock'
    ./dcigettext.c:1016: error: undefined reference to 'pthread_rwlock_rdlock'
    ./dcigettext.c:530: error: undefined reference to 'pthread_rwlock_rdlock'
    ./finddomain.c:87: error: undefined reference to 'pthread_rwlock_rdlock'
    collect2: error: ld returned 1 exit status
    make: *** [buildsharedlibrary_armeabi-v7a] Error 1
    

  • 解决方案:

    android update project --name testing_2 --target 1 --path  /home/username/AndroidStudioProjects/testing_2/app/src/main/
    

  • 错误(当我在手机上运行android应用程序时)

但是我看到了libgstreamer_android.so在那个文件夹里 然后在加载libtest_lib之前,我尝试使用System.loadlibrary(“gstreamer_android”)

然后我得到了这些:

FATAL EXCEPTION: main
E/AndroidRuntime: Process: com.example.flowenol.testing_2, PID: 20447
E/AndroidRuntime: java.lang.NoClassDefFoundError:org/freedesktop/gstreamer/GStreamer

看,你也可能错过了android更新…谢谢alex,我通过android更新修复了错误,但我在运行android应用程序时出错了…你应该写loadLibrary(“gstreamer_android”),没有lib前缀。我知道,我只是忘了写这里,但我写System.loadLibrary(“gstreamer_android”);在我的代码中…谢谢alex,我通过将[org/freedesktop/gstreamer/gstreamer.java]复制到[main/java]来修复它
FATAL EXCEPTION: main
E/AndroidRuntime: Process: com.example.flowenol.testing_2, PID: 20447
E/AndroidRuntime: java.lang.NoClassDefFoundError:org/freedesktop/gstreamer/GStreamer