Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Some libraries and user code require to load jni libs (dynamic libraries).
Our own DexClassLoader has had only access to system libraries. Hence, any libraries one might want to bundle with the code, could not be used.
This PR makes use of the parameter
librarySearchPath
of the constructor fromDexClassLoader
and thus provides theDexClassLoader
the ability to properly link the libraries.An example of a library requiring such a case: https://github.com/xerial/sqlite-jdbc/blob/master/USAGE.md#how-to-use-with-android
In a plain android project, one would add the libraries to a jniLibs dir and the AGP plugin would bundle these with the apk.
But even if one, adds such libraries by hand using godot's gradle build, our classloader would not have access to it. For this, it's parent class loader would need to be the godot app class loader to which we do not have access from inside the cpp code.
Hence this PR provides a dir
jvm/android/jniLibs
to which a user can add all libraries which should be shipped with the app. And that folder is then passed in as a possible path for jniLibs to be loaded from for ourDexClassLoader
.This PR is already in a working state but remains a draft for the following reasons: