ANDROID BUILD TIME

Move Glide from kapt to ksp on Android

Better build performance with glide ksp on Android

ksp is 2 times faster than kapt (sources).

Many libraries like Room are already working with ksp. To benefit fully from ksp performance gain over kapt, move the Glide setup is the way to go.

Gradle plugin

In your app build.gradle.kts

plugins {

// From
kotlin("kapt")

// To
id("com.google.devtools.ksp")
}

Gradle dependencies

In your app build.gradle.kts

dependencies {

// From
implementation("com.github.bumptech.glide:glide:4.14.2")
kapt("com.github.bumptech.glide:compiler:4.14.2")

// To
implementation("com.github.bumptech.glide:glide:4.14.2")
ksp("com.github.bumptech.glide:ksp:4.14.2")
}

Application source code

Remove any reference to generated code like GlideApp and GlideRequests

// From
GlideApp.with(context)
.load(url)
.into(imageView)

// To
Glide.with(context)
.load(url)
.into(imageView)

Sources

--

--