Skip to content

Supported Platforms

Kotbase provides a common Kotlin Multiplatform API for Couchbase Lite, allowing you to develop a single Kotlin shared library, which compiles to native binaries that can be consumed by native apps on each of the supported platforms: Android, JVM, iOS, macOS, Linux, and Windows.

Android + JVM

Kotbase implements support for JVM desktop and Android apps via the Couchbase Lite Java and Android SDKs. Kotbase's API mirrors the Java SDK as much as feasible, which allows for smooth migration for existing Kotlin code currently utilizing either the Java or Android KTX SDKs. See Differences from Couchbase Lite Java SDK for details about where the APIs differ.

Kotbase will pull in the correct Couchbase Lite Java dependencies via Gradle.

Minification

An application that enables ProGuard minification must ensure that certain pieces of Couchbase Lite library code are not changed.

Near-minimal rule set that retains the needed code
proguard-rules.pro
-keep class com.couchbase.lite.ConnectionStatus { <init>(...); }
-keep class com.couchbase.lite.LiteCoreException { static <methods>; }
-keep class com.couchbase.lite.internal.replicator.CBLTrustManager {
    public java.util.List checkServerTrusted(java.security.cert.X509Certificate[], java.lang.String, java.lang.String);
}
-keep class com.couchbase.lite.internal.ReplicationCollection {
    static <methods>;
    <fields>;
}
-keep class com.couchbase.lite.internal.core.C4* {
    static <methods>;
    <fields>;
    <init>(...);
}

Android

API x86 x64 ARM32 ARM64
22+

JVM

JDK Linux x64 macOS x64 Windows x64
8+

JVM on Linux

Targeting JVM running on Linux requires a specific version of the libicu dependency. (You will see an error such as libLiteCore.so: libicuuc.so.71: cannot open shared object file: No such file or directory indicating the expected version.) If the required version isn't available from your distribution's package manager, you can download it from GitHub.

iOS + macOS

Kotbase supports native iOS and macOS apps via the Couchbase Lite Objective-C SDK. Developers with experience using Couchbase Lite in Swift should find Kotbase's API in Kotlin familiar.

Binaries need to link with the correct version of the CouchbaseLite XCFramework, which can be downloaded here or added via Carthage or CocoaPods. The version should match the major and minor version of Kotbase, e.g. CouchbaseLite 3.1.x for Kotbase 3.1.9-1.1.1.

The Kotlin CocoaPods Gradle plugin can also be used to generate a Podspec for your project that includes the CouchbaseLite dependency. Use linkOnly = true to link the dependency without generating Kotlin Objective-C interop:

CocoaPods plugin
build.gradle.kts
plugins {
    kotlin("multiplatform")
    kotlin("native.cocoapods")
}

kotlin {
    cocoapods {
        ...
        pod("CouchbaseLite-Enterprise", version = "3.1.9", linkOnly = true)
    }
}
build.gradle.kts
plugins {
    kotlin("multiplatform")
    kotlin("native.cocoapods")
}

kotlin {
    cocoapods {
        ...
        pod("CouchbaseLite", version = "3.1.9", linkOnly = true)
    }
}

iOS

Version x64 ARM64
10+

macOS

Version x64 ARM64
10.14+

Linux + Windows

Experimental support for Linux and Windows is provided via the Couchbase Lite C SDK. Core functionality should be mostly stable, however these platforms have not been tested in production. There are some tests that have slightly different behavior in a few edge cases and others that are failing that need further debugging. See comments in tests marked @IgnoreLinuxMingw for details.

There are a few Enterprise Edition features that are not implemented in the Couchbase Lite C SDK. Kotbase will throw an UnsupportedOperationException if these APIs are called from these platforms.

Binaries need to link with the correct version of the native platform libcblite binary, which can be downloaded here or here. The version should match the major and minor version of Kotbase, e.g. libcblite 3.1.x for Kotbase 3.1.9-1.1.1.

Linux

Linux also requires libz, libicu, and libpthread, which may or may not be installed on your system.

Targeting Linux requires a specific version of the libicu dependency. (You will see an error such as libLiteCore.so: libicuuc.so.71: cannot open shared object file: No such file or directory indicating the expected version.) If the required version isn't available from your distribution's package manager, you can download it from GitHub.

Distro Version x64 ARM64
Debian 9+
Raspberry Pi OS 10+
Ubuntu 20.04+

Windows

Version x64
10+