在我的Android项目中,我所有的so
库都位于assets/jniLibs/
文件夹中
但是当我尝试这样做时:
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)