You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: Fatal exception when NativeLoader loads same jar-packaged library twice
Solution: Using System.loadLibrary you can load the same library as many
times as you like because subsequent calls will be ignored. But this is
only true if you try to load the same library from the same file.
Because the NativeLoader copies the jar-packaged library to a random
directory in the temp dir we're loading the same library from different
files which causes the java process to abort fatally.
Therefore we will load the libraries with our own static library loader
wrapper that will only call the NativeLoader if that library has not
been load previously. And because we generate the wrapper in every
zproject generated jni libraray the jvm will simply pick up the first
one it encounters hence there's no need to have a common dependency
where that loader is located.
0 commit comments