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
-dontwarn edu.umd.cs.findbugs.annotations.SuppressFBWarnings
-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 interface com.couchbase.lite.internal.ReplicationCollection$C4Filter
-keep class com.couchbase.lite.internal.ReplicationCollection {
static <methods>;
<fields>;
}
-keep class com.couchbase.lite.internal.fleece.FLSliceResult { static <methods>; }
-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.2.x for Kotbase 3.2.4-1.2.0.
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
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.2.x for Kotbase 3.2.4-1.2.0.
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+ |
Using APT
Using the Advanced Package Tool (apt) is the easiest way to install Couchbase Lite on Ubuntu and Debian platforms. Just download the meta package that apt requires to automatically get and install Couchbase Lite, including any dependencies.
-
Download the meta package
-
Install the meta package
-
Update the local package database
-
Install the required release package(s)
Windows
| Version | x64 |
|---|---|
| 10+ |