文件夹资产中的jniLib时出现java.lang.UnsatisfiedLinkError:找不到“ libassets / jniLibs / opvpnutil.so”

时间:2019-09-02 15:05:08

标签: android android-ndk

在我的Android项目中,我所有的so库都位于assets/jniLibs/文件夹中

enter image description here

但是当我尝试这样做时:

static {
    System.loadLibrary("assets/jniLibs/opvpnutil");
    if (Build.VERSION.SDK_INT == Build.VERSION_CODES.JELLY_BEAN)
        System.loadLibrary("assets/jniLibs/jbcrypto");
}

我收到错误消息:

     E/AndroidRuntime(16998): java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.myproject-2/base.apk"],nativeLibraryDirectories=[/data/app/com.myproject-2/lib/arm, /vendor/lib, /system/lib]]] couldn't find "libassets/jniLibs/opvpnutil.so"
 E/AndroidRuntime(16998):   at java.lang.Runtime.loadLibrary(Runtime.java:367)
 E/AndroidRuntime(16998):   at java.lang.System.loadLibrary(System.java:1076)
 E/AndroidRuntime(16998):   at com.myproject.core.NativeUtils.<clinit>(NativeUtils.java:22)
 E/AndroidRuntime(16998):   at com.myproject.VpnProfile.getConfigFile(VpnProfile.java:281)
 E/AndroidRuntime(16998):   at com.myproject.VpnProfile.writeConfigFile(VpnProfile.java:667)
 E/AndroidRuntime(16998):   at com.myproject.core.OpenVPNService.startOpenVPN(OpenVPNService.java:424)
 E/AndroidRuntime(16998):   at com.myproject.core.OpenVPNService.access$300(OpenVPNService.java:65)
 E/AndroidRuntime(16998):   at com.myproject.core.OpenVPNService$2.run(OpenVPNService.java:403)

0 个答案:

没有答案