I'm trying to use chilkat library on an existing app that uses API 16 under Android Studio (macOS - Android Studio 3.5). Needs suggestions about how to correctly import the chilkat library in Android Studio.
I need to determine if the library can be used with the application (about some SFTP operations).
Following the instructions found on the Chilkat site (https://www.chilkatsoft.com/chilkatAndroid.asp) I was able to compile the app including the library. However, in order to compile the app I had to add the Multidex support in the gradle build for the app :
........ ........ android { compileSdkVersion 28 buildToolsVersion '27.0.3' defaultConfig { minSdkVersion 16 targetSdkVersion 16 versionCode 72 versionName '1.6.6' multiDexEnabled true <------- added } dexOptions { javaMaxHeapSize "4g" } ......... ......... dependencies { ....... ....... implementation 'com.android.support:multidex:1.0.3' <---- added }
And the "project structure" of the app is different from the one described in the instructions so I did end up copying the libs files in a jniLibs directory under the /app directory on the project. The source files were copied into : /app/src/main/java/com/chilatsoft
On the main application I did included the lib as suggested by the instruction and added the loader.
In the end I am able to compile the app with no errors, however runtime the app crash indicating that the chilkat library is not found.
java.lang.UnsatisfiedLinkError: Couldn't load chilkat from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/system/framework/com.symbol.emdk.jar", zip file "/data/app/com.xxxxxxxxxxx.apk"],nativeLibraryDirectories=[/data/app-lib/com.xxxxxxxxxxx, /vendor/lib, /system/lib]]]: findLibrary returned null at java.lang.Runtime.loadLibrary(Runtime.java:358)
This make me think I did imported the library not correctly. Any hint/step guide to follow to import chilkat correctly ?
Before to buy the license I would like to be sure that the library can be used for the project. I can't change API or restart from scratch or change structure of the current app.
Thanks for any help ! Steve