Android Can't load vlcjni library (libVLC)

2019-08-30 07:35发布

I can't use

implementation 'de.mrmaffen:libvlc-android:2.1.12@aar' 

if the set minifyEnable to true.

The error message is

Can't load vlcjni library: java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/app//lib/arm64/libvlcjni.so"

How can I use minifyEnable true with libvlc?

1条回答
小情绪 Triste *
2楼-- · 2019-08-30 08:02

if you obfuscate the libvlc there is no way for the native code to find the necessary classes and methods so it returns a JNI_ERR. You just need to exclude the libvlc from ProGuard, add this line in progaurd file

-keep class org.videolan.libvlc.** { *; } 
查看更多
登录 后发表回答