Skip to main content

Installing the Kotlin Multiplatform Barcode Scanner SDK

Specifying the Maven repository

The Scanbot SDK for Kotlin Multiplatform is distributed through our private Maven repository server (nexus.scanbot.io), which needs to be specified in the settings.gradle.kts file in the root folder of your project:

// settings.gradle.kts in the root of the project:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()

// Add Scanbot SDK maven repositories here:
maven(url = "https://nexus.scanbot.io/nexus/content/repositories/releases/")
maven(url = "https://nexus.scanbot.io/nexus/content/repositories/snapshots/")
}
}

Afterward, the dependencies can be added in the dependencies section of your Kotlin Multiplatform application project configuration, usually in the build.gradle.kts file.

Adding the main SDK dependency

The SDK provides two separate dependencies depending on your needs:

Core SDK Barcode

app/build.gradle.kts
commonMain.dependencies {
implementation("io.scanbot:kmp-barcode-sdk:$scanbotSdkVersion")
}

This dependency provides the complete Kotlin Multiplatform API for barcode scanning functionality. It includes all core features for barcode detection, processing, and configuration across Android and iOS.

Compose UI Components

app/build.gradle.kts
commonMain.dependencies {
implementation("io.scanbot:kmp-compose-ui-barcode-sdk:$scanbotSdkVersion")
}

This dependency includes ready-to-use Compose Multiplatform UI components, specifically the barcode custom UI view. Add this to use the pre-built Compose interface for barcode scanning instead of building your own UI from scratch.

note

The kmp-compose-ui-barcode-sdk dependency requires kmp-barcode-sdk as it builds on top of the core API.

Get the latest $scanbotSdkVersion from the Changelog.

Android setup

No additional configuration is needed.

iOS setup

On iOS, the official Scanbot SDK is not linked as a transitive dependency. Therefore, any project using this SDK needs to link the actual Scanbot SDK as well. This can be done through your preferred installation method (CocoaPods/SPM).

Installation

Want to scan longer than one minute?

Generate a free trial license to test the Scanbot SDK thoroughly.

Get free trial license