LibVLC: Can‘t load vlcjni library“__emutls_get_address“ “/lib/arm/libvlc.so“

项目一段时间没用过VLC,啥也没改,使用时突然出现如下这段报错:

LibVLC: Can't load vlcjni library: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/com.reach.thousandyear-zuo33K1Bp2_hyLBpvmik5A==/lib/arm/libvlc.so"...

大致意思是找不到libvlc.so这个库了,回想这段时间有加其他的库,猜测是其他库导致和vlc有冲突了,在另外一位博主上找到了思路,在此对该位博主表达感谢:java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol “__emutls_get_address“ refere..._柳逸尘666的博客-CSDN博客 

问题是不同子项止间编译的版不一致,所以将全部编译都改成一致吧,这个我改成这样就没报错了:

externalNativeBuild {
            cmake {
           
                cppFlags "-std=c++11", "-D__STDC_CONSTANT_MACROS"
                arguments "-DANDROID_PLATFORM_LEVEL=21",
                        '-DANDROID_TOOLCHAIN=clang'
            }
        }

如果还是报错,也可以加这个shared.so库试试:

packagingOptions {
        pickFirst 'lib/armeabi-v7a/libc++_shared.so'
    }

你可能感兴趣的:(Android,C++,android,VLC,libvlc.so,C++)