Writing Kotlin?

Kotlin coroutines misbehaving or Gradle refusing to cooperate? We sort it out.

Kotlin is a well-designed language sitting on top of two of the most complex build systems in modern software (Gradle on the client, Gradle or Maven on the server), and that is where most of the pain lives. A coroutine that forgot its Dispatcher, a Jetpack Compose recomposition that runs forty times per key press, a Ktor route holding a database connection past a timeout, we work through the real stack trace until the issue is pinned down and solved.

  • Since 2015Fixing technology
  • FreeEstimates
  • US teamReal engineers

gradle-build.log

still failing

What it is

Kotlin at a glance

Kotlin is a statically typed JVM language created by JetBrains and first released in 2011, with version 1.0 shipping in 2016. Google announced it as a first-class Android language in 2017 and the preferred language in 2019, which made it the default choice for new Android apps. It also runs on the server (Spring, Ktor, Micronaut), compiles to JavaScript via Kotlin/JS, and targets native through Kotlin/Native.

The language's standout features are null safety, concise syntax, data classes, extension functions, sealed types and structured concurrency through coroutines. Kotlin Multiplatform lets shared business logic target iOS, Android, server and web from a single codebase, and the Jetpack Compose UI toolkit on Android is Kotlin-first. Build systems, Gradle on Android and the backend side, are the usual source of friction, not the language itself.

Type
Statically typed JVM language with multiplatform targets
First released
2011 preview, 2016 version 1.0
License
Apache 2.0
Maintained by
JetBrains and the Kotlin Foundation
Typically used for
Android apps, JVM backend services (Spring, Ktor), multiplatform libraries, server-side tooling

The honest version

Kotlin pros and cons

No technology is all upside. This is where Kotlin earns its place and where it tends to cause trouble.

Where Kotlin is strong

  • Null safety by defaultNullable and non-nullable types are tracked by the compiler, which catches most of the NullPointerExceptions that haunt mature Java codebases before they can crash in production.
  • Concise without being cleverData classes, named arguments, default parameters, extension functions and smart casts all cut boilerplate without hiding what the code does from a reader.
  • Coroutines for structured concurrency`suspend` functions, scopes and dispatchers give a coherent model for async work that fits both Android UI and server I/O, with cancellation that actually propagates.
  • Interoperable with JavaMixed codebases work cleanly. You can call Java libraries from Kotlin and vice versa without wrappers, which matters for migrating large existing JVM stacks.
  • First-class on AndroidJetpack Compose, Jetpack libraries, Android Studio refactorings and Android Gradle Plugin all target Kotlin as the primary language, which keeps the Android story coherent.
  • Multiplatform is maturingKotlin Multiplatform now covers shared business logic across Android, iOS, server and web in production, and tooling has improved year over year.

Where Kotlin bites

  • Gradle is where the pain livesBuild times, incremental compilation quirks, dependency resolution failures, KAPT processors slowing the build and the Kotlin DSL vs Groovy debate all consume engineering time that has nothing to do with the language.
  • Compose has a learning curveRecomposition rules, state hoisting, remember and derivedStateOf, side-effect APIs and performance tuning all take real time to learn, and bad patterns are expensive once they are in the codebase.
  • KAPT is slow, KSP is still maturingAnnotation processing in Kotlin is a known bottleneck. Moving from KAPT to KSP helps materially but requires every annotation processor you use to support it.
  • AGP and Kotlin version couplingThe Android Gradle Plugin, Kotlin version, Jetpack libraries and Compose compiler all have to line up. Upgrading one often forces a chain of other updates.
  • Coroutine mistakes are quietA scope launched without a parent, a dispatcher never specified, an exception swallowed in a supervisor job, all look normal in code and manifest as hard-to-reproduce flakiness in production.
  • Server-side hiring is thinner than JavaKotlin on the backend is excellent, but finding engineers with real Kotlin server experience is still harder than finding Java engineers, especially outside major tech hubs.

Sound familiar?

Common Kotlin problems we fix

The Kotlin problems that bring people to us, and what you have once each one is fixed.

Could not find required JDK tools

The project will not build after a toolchain change

A JDK version mismatch between Gradle, Kotlin and Android Studio, or an IDE pointing at a JDK that is no longer installed. Everything compiles until it does not.

Toolchain consistent across env

Module with the Main dispatcher is missing

Coroutines crash on startup

`Dispatchers.Main` referenced without the `kotlinx-coroutines-android` or `-javafx` artifact on the classpath, so the dispatcher factory fails to initialize.

Dispatchers available at runtime

viewModelScope outlived ViewModel

Coroutine scopes are leaking

Work launched on the wrong scope, cancellation not propagating because a `SupervisorJob` swallowed it, or a flow collector never cancelled on screen teardown.

Scopes bounded to their lifecycles

AGP 7.x no longer supported

Android Gradle Plugin is years behind

AGP, Kotlin and Compose compiler frozen at versions that no longer get fixes, Jetpack libraries dropping support for the old plugin, and new Play Store rules forcing the upgrade anyway.

Project on current AGP and Kotlin

no project README, previous dev gone

We inherited an Android app we cannot build

A repo that built on one engineer's Mac, with hardcoded SDK paths, local.properties in version control, and keystores we do not have. Every build fails differently.

Buildable anywhere, keystore owned

OOMError: Metaspace (Gradle daemon)

Gradle is slow or runs out of memory

Heavy KAPT processors, oversized annotation generators, or Gradle daemon settings that have not been tuned for the project size. Every full build costs a coffee break.

Builds inside a sensible time budget

Composition requires an active composer

Jetpack Compose recomposes in loops

Unstable state objects, readable state inside `remember` without keys, side effects that invalidate the composition that owns them, or lambdas not kept stable across recompositions.

Recomposition scoped and stable

duplicate class kotlin.collections.jdk8.*

Dependency conflicts break the build

Multiple Kotlin stdlib variants on the classpath, usually because a transitive dependency pinned an older stdlib-jdk8 artifact that now overlaps with the main stdlib.

Dependency tree deduplicated

What we do

Kotlin help, from build fixes to shipping features

Call us for one broken build, or for the whole Android or JVM project.

Android build rescue
Gradle sync failures, AGP and Kotlin version upgrades, KAPT to KSP migrations, and keystores and signing brought under your control.
Coroutines and concurrency
Scope design, dispatcher selection, exception handling and cancellation review for apps where async work is misbehaving under real users.
Jetpack Compose performance
Recomposition profiling, state hoisting fixes, stability review and layout work for Compose screens that stutter or over-render.
Spring Boot and Ktor on Kotlin
Server-side Kotlin services, with coroutines, persistence, auth and observability wired up the way production actually needs.
Legacy Android takeover
An app built by a past team or agency brought under your developer account, your repo and your Play Console, with documentation good enough for a new engineer on day one.
Managed Tech
Version planning for Kotlin, AGP and Compose, dependency hygiene, release pipelines and someone to call when a Play Store rule change forces an unexpected update.

How it works

From first message to fixed

  1. Look Free estimate

    Tell us what's going wrong. We look at it, then tell you plainly what's wrong and what it will cost.

  2. Fix

    We fix the cause, not the symptom. If something is down, getting it back up comes first.

  3. Harden

    Backups, monitoring, updates and access, so the same problem can't quietly come back.

  4. Hand back or stay on

    You get a plain-language write-up. Or we stay on for hosting, upkeep and new work.

Often found together

Running Kotlin alongside something else?

We work on the whole stack, so the problem can be wherever it actually is.

Questions

Kotlin questions

Something else? Call+1 737 727 7327

Should we migrate our Android app from Java to Kotlin?

Usually yes, module by module. Mixed Java and Kotlin codebases work cleanly, so you do not need a big-bang rewrite. New code goes in Kotlin, and we convert existing Java files on the touch-it-anyway rule: whenever a file is being changed substantively, that is the right moment to flip it. Jetpack libraries and AGP increasingly assume Kotlin, so the conversion also future-proofs the project.

Why are our coroutine-based features flaky in production?

Almost always because of scope and dispatcher choices. Work launched on the wrong scope outlives the thing that started it, exceptions get swallowed inside supervisor jobs, and dispatcher choices block the main thread without anyone noticing on dev builds. We trace the real crash reports, redesign the scopes, and pin the dispatcher rules in code review.

Can you take over an Android app from a previous developer?

Yes, that is a frequent engagement. We bring the Google Play account, signing keystore, Firebase project and repo under your ownership, upgrade to a supported AGP and Kotlin version, and leave you with a runbook plus a plan for what to clean up next. From there we either keep maintaining or hand over to your internal team.

Should we use Kotlin Multiplatform or go native per platform?

It depends on the shape of the shared code. If the business rules, networking and models overlap heavily across iOS and Android, KMP can cut duplication meaningfully. If the apps are UI-heavy with very little shared logic, keeping two native codebases is often simpler. We will tell you honestly which case your product is in before you commit to the toolchain.

Why does our Gradle build take ten minutes?

The common culprits are KAPT annotation processors (fixable by moving to KSP), oversized monolithic modules (fixable by splitting), unnecessary clean builds on CI, and Gradle daemon settings that have not been tuned. We profile the build with `--scan`, fix the hot path, and get the time back into a normal range.

How much does Kotlin help cost?

Estimates come free. Share the repo link or a note on the Kotlin and AGP versions plus what is failing, and a price lands before any work begins.

Free estimate

Kotlin project giving you trouble?

Tell us what you're running and what's going wrong. A person reads it and comes back with an estimate.

  • No charge to find out what it will take
  • If it's urgent, say so

Replies come from a person. By sending, you authorize us to email you back. No marketing.