Where to Put the Chilkat JNI Shared Libraries (Android)

On Android, the native JNI library (libchilkat.so) must be placed so it's packaged into your APK under the correct ABI (architecture) folder. This page shows where the files go and how to avoid the common UnsatisfiedLinkError.

Where the .so files go in your project

The Chilkat Android download contains one libchilkat.so per ABI under libs/. In an Android Studio project, copy each into the matching ABI folder under app/src/main/jniLibs/:

app/src/main/jniLibs/
├─ arm64-v8a/     libchilkat.so
├─ armeabi-v7a/   libchilkat.so
├─ x86/          libchilkat.so
└─ x86_64/       libchilkat.so

When you build, Gradle automatically packages these into the APK under the lib/<abi>/ folder, and Android loads the one matching the device's architecture at runtime. (Keep the ABI folder names exactly as shown.)


Which ABIs to include

ABI folderUsed by
arm64-v8a64-bit ARM — nearly all modern devices (required for Google Play)
armeabi-v7aOlder 32-bit ARM devices
x86_6464-bit x86 emulators (and some Chromebooks)
x8632-bit x86 emulators

Include every ABI you intend to support. At minimum, include arm64-v8a for real devices; add x86_64 if you run the x86 emulator. You can restrict the packaged ABIs in build.gradle:

android {
    defaultConfig {
        ndk {
            abiFilters "arm64-v8a", "armeabi-v7a", "x86_64"
        }
    }
}

Load the library in code

Load the native library once before using any Chilkat class — pass the name without the lib prefix or .so extension:

// e.g. in a static initializer or Application.onCreate
System.loadLibrary("chilkat");

Troubleshooting UnsatisfiedLinkError

  1. Confirm the .so is in the APK

    An .apk is a ZIP archive — open it and check that lib/<abi>/libchilkat.so is present for the device's architecture.

  2. Match the device's ABI

    Make sure you included the ABI the device/emulator uses (most physical devices are arm64-v8a). If you set abiFilters, confirm it lists that ABI.

  3. Check the library name

    The name passed to System.loadLibrary must be "chilkat" — not "libchilkat" or "libchilkat.so".

  4. Read logcat

    Run adb logcat to see the exact reason the library failed to load.

16 KB page sizes If the library fails to load on a recent (Android 15+) device, it may be a 16 KB memory page-size issue. Chilkat supports 16 KB pages since version 9.5.0.99 — use that version or later. See Chilkat supports 16K Android page sizes.

← Back to Chilkat for Android