Recently we are using nativescript to build an app, and we need to use a third-patty library which provides both IOS and Android SDK. But it failed even we push .so file to
A better way to push .so files and .jar files together, is to repackage them as an .aar file, using Android Studio. Then copy the wrapper .aar file to your nativescirpt platform/android/libs folder.
Here are the steps to package your SDK .jar and .so files into an aar file.
Currently this task is not automated in the tns
CLI but it should be possible to copy your *.so
files in <project>/platforms/android/libs/jni/armeabi-v7a
and/or <project>/platforms/android/libs/jni/x86
directories. Gradle build respects these folders and *.so
files will be included in the *.apk
package.
addition to for Karthik Sankar
's answer.
my *.so files got copied to app but did not get referenced.
In this case you need to manually reference all of them like this.
java.lang.System.loadLibrary("avcodec");
to check if *.so
files get copied use Native Libs Monitor
app.
ReLinker
might be helpful too
for detail https://github.com/bytedeco/javacpp-presets/issues/303