I tried to follow the example code on how to load native library in the root process, however, according to their javadoc both System.loadLibrary() and Runtime.getRuntime().loadLibrary() expect a library name instead of a library path. So when I tried to pass in a path, I got the following error (on API 27):
java.lang.UnsatisfiedLinkError: Directory separator should not appear in library name: ...
After some search, I found that System.load() or Runtime.getRuntime().load() should be used for a library path, and I actually loaded my libraries successfully with them. So maybe the example code is calling the wrong method?
I tried to follow the example code on how to load native library in the root process, however, according to their javadoc both
System.loadLibrary()andRuntime.getRuntime().loadLibrary()expect a library name instead of a library path. So when I tried to pass in a path, I got the following error (on API 27):After some search, I found that
System.load()orRuntime.getRuntime().load()should be used for a library path, and I actually loaded my libraries successfully with them. So maybe the example code is calling the wrong method?