Setup Kotlin DataFrame on Android
Kotlin DataFrame doesn't provide a dedicated Android artifact yet, but you can add the Kotlin DataFrame JVM dependency to your Android project with minimal configuration:
dependencies {
// Core Kotlin DataFrame API, CSV and JSON IO.
// See custom Gradle setup:
// https://kotlin.github.io/dataframe/setupcustomgradle.html
implementation("org.jetbrains.kotlinx:dataframe-core:1.0.0-Beta3")
implementation("org.jetbrains.kotlinx:dataframe-json:1.0.0-Beta3")
implementation("org.jetbrains.kotlinx:dataframe-csv:1.0.0-Beta3")
// You can add any additional IO modules you like, except for 'dataframe-arrow'.
// Apache Arrow is not supported well on Android.
}
android {
defaultConfig {
minSdk = 21
}
// Requires Java 8 or higher
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
dependencies {
// Core Kotlin DataFrame API, CSV and JSON IO.
// See custom Gradle setup:
// https://kotlin.github.io/dataframe/setupcustomgradle.html
implementation 'org.jetbrains.kotlinx:dataframe-core:1.0.0-Beta3'
implementation 'org.jetbrains.kotlinx:dataframe-json:1.0.0-Beta3'
implementation 'org.jetbrains.kotlinx:dataframe-csv:1.0.0-Beta3'
// You can add any additional IO modules you like, except for 'dataframe-arrow'.
// Apache Arrow is not supported well on Android.
}
android {
defaultConfig {
minSdk 21
}
// Requires Java 8 or higher
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions.jvmTarget = "1.8"
}
This setup adds the Kotlin DataFrame core as well as a subset of the IO modules (excluding experimental ones). For flexible configuration, see Custom configuration.
Kotlin DataFrame Compiler Plugin
Kotlin DataFrame Compiler Plugin enables automatic generation of extension properties and updates data schemas on-the-fly in Android projects, making development with Kotlin DataFrame faster, more convenient, and fully type- and name-safe.
To enable the plugin in your Gradle project, add it to the plugins
section:
plugins {
kotlin("plugin.dataframe") version "2.2.20"
}
plugins {
id 'org.jetbrains.kotlin.plugin.dataframe' version '2.2.20'
}
Due to this issue, incremental compilation must be disabled for now. Add the following line to your gradle.properties
file:
kotlin.incremental=false
01 October 2025