无法阅读libvlcjni.so;无法检查设备ABI

时间:2014-05-21 09:18:44

标签: android libvlc

我按照here的程序编译了libVlc for android。编译的项目在eclipse中没有显示任何错误,但是当我在设备上运行时,它会抛出以下错误

05-21 14:37:50.834: D/dalvikvm(14423): GC_CONCURRENT freed 181K, 8% free 9633K/10439K, paused 17ms+7ms, total 62ms
05-21 14:37:51.034: E/VLC/LibVLC/Util(14423): WARNING: Unable to read libvlcjni.so; cannot check device ABI!
05-21 14:37:51.034: E/VLC/LibVLC/Util(14423): WARNING: Cannot guarantee correct ABI for this build (may crash)!
05-21 14:37:51.065: W/VLC/LibVLC(14423): Unable to load the iomx library: java.lang.UnsatisfiedLinkError: Couldn't load iomx-ics: findLibrary returned null
05-21 14:37:51.065: E/VLC/LibVLC(14423): Can't load vlcjni library: java.lang.UnsatisfiedLinkError: Couldn't load vlcjni: findLibrary returned null

请提前帮助我解决问题

2 个答案:

答案 0 :(得分:2)

您收到此错误是因为您没有导出设备的abi,如说明中所述。我将假设您也没有按照文档中的“环境设置”部分进行操作。所以,做如下:

确保已下载NDK,然后在终端中运行此(带路径):

  

导出ANDROID_NDK = / path / to / android-ndk>

然后,编译.sh文件并导出您的设备(或模拟器的abi)。由于脚本处理abi,因此.sh文件的编译直接链接到abi问题。您可以在脚本代码(compile.sh)中看到这一点:

# try to detect NDK version
REL=$(grep -o '^r[0-9]*.*' $ANDROID_NDK/RELEASE.TXT 2>/dev/null|cut -b2-)
case "$REL" in
    9*)
        GCCVER=4.8
        CXXSTL="/"${GCCVER}
    ;;
    8?*)
        # we don't use 4.4.3 because it doesn't handle threads correctly.
        # TODO : clang?
        if test -d ${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.7
        # if gcc 4.7 is present, it's there for all the archs (x86, mips, arm)
        then
            # since r8d
            GCCVER=4.7
        else
            GCCVER=4.6
        fi
        CXXSTL="/"${GCCVER}
    ;;
    7|8|*)
        echo "You need the NDKv8b or later"
        exit 1
    ;;
esac

export GCCVER
export CXXSTL

# Set up ABI variables
if [ ${ANDROID_ABI} = "x86" ] ; then
    TARGET_TUPLE="i686-linux-android"
    PATH_HOST="x86"
    HAVE_X86=1
    PLATFORM_SHORT_ARCH="x86"
elif [ ${ANDROID_ABI} = "mips" ] ; then
    TARGET_TUPLE="mipsel-linux-android"
    PATH_HOST=$TARGET_TUPLE
    HAVE_MIPS=1
    PLATFORM_SHORT_ARCH="mips"
else
    TARGET_TUPLE="arm-linux-androideabi"
    PATH_HOST=$TARGET_TUPLE
    HAVE_ARM=1
    PLATFORM_SHORT_ARCH="arm"
fi

我建议再次阅读Android Compile文档,并按照说明一步一步。

答案 1 :(得分:1)

如果您使用的是Android Studio,请将*.so移至src/jniLibs/armeabi-v7a

i