# ksp

Published articles for ksp.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Migrating to AGP 9.2.1: Kotlin build errors I hit and how I fixed them

DevFeed: [Migrating to AGP 9.2.1: Kotlin build errors I hit and how I fixed them](<https://devfeed.tech/articles/migrating-to-agp-9-2-1-kotlin-build-errors-i-hit-and-how-i-fixed-them-25977.md>)

Original publisher: [Read original article](<https://navczydev.medium.com/migrating-to-agp-9-2-1-kotlin-build-errors-i-hit-and-how-i-fixed-them-1565bb36b96f?source=rss-711ab22c5c77------2>)

Author: Nav Singh

Published: 2026-05-27T01:03:56Z

Content type: tutorial

Language: en

Sources: [Stories by Nav Singh 🇨🇦 on Medium](<https://devfeed.tech/sources/stories-by-nav-singh-on-medium.md>)

Topics: [Android](<https://devfeed.tech/topics/android.md>), [migration](<https://devfeed.tech/topics/migration.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [developer tooling](<https://devfeed.tech/topics/developer-tooling.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [android-gradle-plugin](<https://devfeed.tech/tags/android-gradle-plugin.md>), [androiddev](<https://devfeed.tech/tags/androiddev.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [dagger-hilt](<https://devfeed.tech/tags/dagger-hilt.md>), [errors](<https://devfeed.tech/tags/errors.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [ksp](<https://devfeed.tech/tags/ksp.md>), [migration](<https://devfeed.tech/tags/migration.md>)

### AI overview

A tutorial documenting a small Android project migration to AGP 9.2.1. It explains build errors caused by AGP 9's built-in Kotlin support and shows fixes involving removal of the old Kotlin Android plugin, migration from KAPT to KSP for Hilt, and replacement of the legacy kotlinOptions DSL.

### Source excerpt

Image generate using perplexity I recently upgraded an Android project to AGP 9.2.1 and ran into a chain of build errors. In my case, the project was a very small app, so there might be more issues if the project setup is complicated. Each one pointed to a different part of the new Kotlin/Gradle setup, and fixing them one by one made the migration much clearer. Why this happened AGP 9 introduces built-in Kotlin support that changes the old plugin setup (org.jetbrains.kotlin.android). 🛑 kapt, and kotlinOptions no longer work the same way. Error 1: Cannot add extension with name kotlinCannot add extension with name 'kotlin', as there is an extension already registered with that name. The fix was to remove the Kotlin Android plugin from the module and any root-level declarations that still applied it. AGP 9 already provides Kotlin support, so applying the old plugin causes a duplicate kotlin extension.Fixplugins { id("com.android.application") // remove: id("org.jetbrains.kotlin.android") }Error 2: org.jetbrains.kotlin.kapt is not compatible with built-in Kotlin support After removing the Kotlin Android plugin, the next failure came from kapt The 'org.jetbrains.kotlin.kapt' plugin is not compatible with built-in Kotlin support. Android's migration guide recommends moving to KSP, or using com.android.legacy-kapt only as a temporary fallback.Fix After removing kapt, we need to update the affected libraries. In my case, only Hilt was affected, so I updated it with the KSP plugins { //.... // Remove KAPT kotlin("kapt") // Add KSP id("com.google.devtools.ksp") } // dependencies dependencies { // kapt(libs.hilt.compiler) ksp(libs.dagger.hilt.compiler) // ... }Error 3: Unresolved reference: kotlinOptions Once kapt was out of the way, the build hit another issue 🤯 Unresolved reference 'kotlinOptions' That's because AGP 9 built-in Kotlin uses the new Kotlin compiler options DSL instead of the old android.kotlinOptions {} block. The Android migration doc says to move those setti

## Migrating from Koin DSL to Koin Annotations in a Multimodule Project: A Step-by-Step Guide

DevFeed: [Migrating from Koin DSL to Koin Annotations in a Multimodule Project: A Step-by-Step Guide](<https://devfeed.tech/articles/migrating-from-koin-dsl-to-koin-annotations-in-a-multimodule-project-a-step-by-step-guide-22975.md>)

Original publisher: [Read original article](<https://blog.insert-koin.io/migrating-from-koin-dsl-to-koin-annotations-in-a-multimodule-project-a-step-by-step-guide-a38a82f56e17?source=rss----925561f2ecdf---4>)

Author: Gabriel Bronzatti Moro

Published: 2026-04-24T07:18:23Z

Content type: tutorial

Language: en

Sources: [Koin developers - Medium](<https://devfeed.tech/sources/koin-developers-medium.md>)

Topics: [multiplatform](<https://devfeed.tech/topics/multiplatform.md>), [compose-multiplatform](<https://devfeed.tech/topics/compose-multiplatform.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [Code generation](<https://devfeed.tech/topics/code-generation.md>)

Tags: [code-generation](<https://devfeed.tech/tags/code-generation.md>), [compose](<https://devfeed.tech/tags/compose.md>), [compose-multiplatform](<https://devfeed.tech/tags/compose-multiplatform.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [guide](<https://devfeed.tech/tags/guide.md>), [koin](<https://devfeed.tech/tags/koin.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [ksp](<https://devfeed.tech/tags/ksp.md>), [multi-module-project](<https://devfeed.tech/tags/multi-module-project.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

### AI overview

A step-by-step tutorial for migrating a Compose Multiplatform multimodule project from Koin DSL to Koin Annotations. It covers adding Koin Annotations and KSP dependencies, creating a Gradle convention plugin, enabling the setup in a module, and replacing manual Koin definitions with annotation-based registration.

### Source excerpt

Hey friends 👋 Today we're going to explore how to migrate a Compose Multiplatform multi-module project from Koin DSL to Koin Annotations. We'll take a hands-on approach, diving deep into a project example built by the CodandoTV community. ⚠ In this tutorial, we won't cover the new Koin compiler. It's a significant improvement that simplifies much of the complexity we currently deal with when using KSP, but it deserves its own dedicated deep dive. A person's hand fitting a piece into a puzzle -- Unplash by rosssneddonFirst step: Setup Koin Annotations dependency First thing is let's make sure we are running the latest version of Koin. For that, visit our documentation. After that, let's add our Koin Annotations dependency into the libs.versions.toml . // gradle/libs.versions.toml [versions] koin-annotations = "<latest-version>" ksp = "<latest-version>" ... [libraries] ... com-google-devtools-ksp-gradle-plugin = { module = "com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin", version.ref = "ksp" } koin-annotations = { module = "io.insert-koin:koin-annotations", version.ref = "koin-annotations" } koin-ksp-compiler = { module = "io.insert-koin:koin-ksp-compiler", version.ref = "koin-annotations" } KSP is also required, as it enables the code generation used by Koin Annotations. After adding the dependencies, run a Gradle sync to make them available to the project. Let's make sure we have the ksp plugin enabled in the root gradle project: // root/build.gradle.kts plugins { alias(libs.plugins.ksp) apply false ... } Let's head over to the build-logic folder and encapsulate all this setup inside a new Gradle convention plugin. To make this work, we need to add KSP as a library dependency: // build-logic/build.gradle.kts ... dependencies { implementation(libs.com.google.devtools.ksp.gradle.plugin) } Again, let's run Gradle sync 🐘 Second step: Create your conventional Gradle Plugin Inside of your build-logic , let's create a new custom plugin, we can call it com.st

## Kotlin Symbol Processing

DevFeed: [Kotlin Symbol Processing](<https://devfeed.tech/articles/kotlin-symbol-processing-39209.md>)

Original publisher: [Read original article](<https://kt.academy/article/ak-ksp>)

Published: 2023-11-27T00:15:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [Code](<https://devfeed.tech/topics/code.md>), [Java](<https://devfeed.tech/topics/java.md>)

Tags: [compilation](<https://devfeed.tech/tags/compilation.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [ksp](<https://devfeed.tech/tags/ksp.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This tutorial explains Kotlin Symbol Processing (KSP) as a Kotlin-focused alternative to Java Annotation Processing. It covers KSP's code analysis and file generation capabilities, API advantages, performance characteristics, and the implementation of an example processor using Gradle.

### Source excerpt

All the essential aspects of KSP in practice.

## KotlinConf'23 -- Meta-programming with KSP and Kotlin compiler plugins by Tadeas Kriz

DevFeed: [KotlinConf'23 -- Meta-programming with KSP and Kotlin compiler plugins by Tadeas Kriz](<https://devfeed.tech/articles/kotlinconf-23-meta-programming-with-ksp-and-kotlin-compiler-plugins-by-tadeas-kriz-27028.md>)

Original publisher: [Read original article](<https://appmattus.medium.com/kotlinconf23-meta-programming-with-ksp-and-kotlin-compiler-plugins-by-tadeas-kriz-45dd57d30e47?source=rss-be40b368c57e------2>)

Author: Matthew Dolan

Published: 2023-04-15T01:27:49Z

Content type: opinion

Language: en

Sources: [Stories by Matthew Dolan on Medium](<https://devfeed.tech/sources/stories-by-matthew-dolan-on-medium.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-app-development](<https://devfeed.tech/tags/android-app-development.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [documentation](<https://devfeed.tech/tags/documentation.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [java](<https://devfeed.tech/tags/java.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-compiler](<https://devfeed.tech/tags/kotlin-compiler.md>), [kotlinconf](<https://devfeed.tech/tags/kotlinconf.md>), [ksp](<https://devfeed.tech/tags/ksp.md>)

### AI overview

The article reflects on a KotlinConf'23 talk about metaprogramming with KSP and Kotlin compiler plugins. It compares approaches for generating or altering code during compilation, discusses Kotlin compiler extensions and JVM IR, and recommends using KSP where possible.

### Source excerpt

KotlinConf'23 -- Meta-programming with KSP and Kotlin compiler plugins by Tadeas Krizhttps://medium.com/media/5209f3d53633efc6fd3a4ca4879001cc/href I really enjoyed watching the talk on meta-programming by Tadeáš Kříž at KotlinConf'23 where he provided an excellent overview of the two main options for generating and/or altering code during compilation. It was great to see the pros and cons of each option even compared to Java's annotation processing which more developers are familiar with. "there are the things that break your heart 💔" The lack of documentation around writing a Kotlin Compiler Plugin makes getting started hard work. Fortunately the speaker provides plenty of links to resources you can use to help you on your way -- I wish I'd seen this talk before writing my own compiler plugin last week! Perhaps you were aware of the move to JVM IR; for most Kotlin developers the compiler implementation doesn't really matter unless, of course, you are writing a compiler plugin. As such it was interesting to have an overview of both SyntheticResolveExtension and IrGenerationExtension. How do you decide what to use for meta-programming? Prefer KSP where possible. The talk mentions plenty of examples of KSP and Kotlin Compiler Plugins you can check out to help you write your own plugin. Additionally, during the conference I had the opportunity to talk with Tadeas about a Kotlin Compiler Plugin he's been writing, Skie (pronounced sky) which, by the way, looks awesome. We both have our fingers crossed that it can become open source so the Kotlin community has another good example of how to write a compiler plugin. "What do you do next. Hopefully profit." You can find my thoughts on more KotlinConf'23 talks at KotlinConf'23. Please let me know your thoughts. Join medium to read all of my articles or subscribe for e-mail updates.

## A birds-eye view of Arrow: Data Immutability with Arrow Optics

DevFeed: [A birds-eye view of Arrow: Data Immutability with Arrow Optics](<https://devfeed.tech/articles/a-birds-eye-view-of-arrow-data-immutability-with-arrow-optics-39301.md>)

Original publisher: [Read original article](<https://kt.academy/article/fk-arrow-optics>)

Published: 2022-12-19T00:15:00Z

Content type: tutorial

Language: en

Sources: [Kt. Academy](<https://devfeed.tech/sources/kt-academy.md>)

Topics: [Functional programming](<https://devfeed.tech/topics/functional-programming.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [API](<https://devfeed.tech/topics/api.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [arrow](<https://devfeed.tech/tags/arrow.md>), [code](<https://devfeed.tech/tags/code.md>), [functional-programming](<https://devfeed.tech/tags/functional-programming.md>), [immutability](<https://devfeed.tech/tags/immutability.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [ksp](<https://devfeed.tech/tags/ksp.md>), [lens](<https://devfeed.tech/tags/lens.md>), [workshop-learning-programming](<https://devfeed.tech/tags/workshop-learning-programming.md>)

### AI overview

This tutorial introduces Arrow Optics for transforming nested immutable data in Kotlin. It explains how Arrow Optics uses a basic library and a compiler plug-in built with Kotlin Symbol Processing, with annotations generating lenses that combine getters and setters.

### Source excerpt

Learn to use Arrow Optics to support working on immutable objects.

## MocKMP : a Mocking processor for Kotlin/Multiplatform

DevFeed: [MocKMP : a Mocking processor for Kotlin/Multiplatform](<https://devfeed.tech/articles/mockmp-a-mocking-processor-for-kotlin-multiplatform-22863.md>)

Original publisher: [Read original article](<https://medium.com/kodein-koders/mockmp-a-mocking-processor-for-kotlin-multiplatform-51957c484fe5?source=rss----f311f45ef54---4>)

Author: Salomon BRYS

Published: 2022-01-17T13:29:28Z

Content type: tutorial

Language: en

Sources: [Kodein Koders - Medium](<https://devfeed.tech/sources/kodein-koders-medium.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Mocking](<https://devfeed.tech/topics/mocking.md>), [Code](<https://devfeed.tech/topics/code.md>), [test](<https://devfeed.tech/topics/test.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [Programming](<https://devfeed.tech/topics/programming.md>)

Tags: [gradle](<https://devfeed.tech/tags/gradle.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-native](<https://devfeed.tech/tags/kotlin-native.md>), [ksp](<https://devfeed.tech/tags/ksp.md>), [mocking](<https://devfeed.tech/tags/mocking.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [test](<https://devfeed.tech/tags/test.md>), [tests](<https://devfeed.tech/tags/tests.md>)

### AI overview

This article introduces MocKMP, a mocking solution for Kotlin Multiplatform. It explains why JVM reflection-based mocking does not work for Kotlin/JS and Kotlin/Native, and describes using Kotlin Symbol Processing to generate mock implementations at compile time. MocKMP includes a runtime API, a symbol processor, test helpers, and a Gradle plugin.

### Source excerpt

MocKMP : a Mocking processor for Kotlin/MultiplatformPhoto by Stefano Pollio on Unsplash Recently, when working with Deezer on a Kotlin/Multiplatform project, we came across multiple unit tests that were written in src/androidTest/kotlin, meaning that they were only run on Android. When investing why that choice was made, the answer became evident : there is no mocking system on Kotlin/Multiplatform, and Mockk only supports JVM & Android. Mocking with reflection The JVM reflection is an amazing powerful API, allowing libraries to instrument existing classes and create new implementations at run time. When you write : https://medium.com/media/28a2defcfc5197a7e44d270d4414acd1/href ...the mocking library : Creates a new implementation of the Repository type Sets the behaviour of the getUser method on this mock to return a fake User, whatever the id parameter. Furthermore, a JVM mocking framework is able to create "fake objects" on demand: https://medium.com/media/2e91c376131e77315f319705fd45e8b2/href All of that is done at run time, by instrumenting the JVM runtime, which is not possible with 2 of the 3 types of targets of Kotlin/Multiplatform (Kotlin/JS & Kotlin/Native). A Kotlin Symbol Processor Google KSP allows to inspect Kotlin code at compile time. In essence, it provides a reflection API available at compile time (rather than at run time). KSP also allows to generate Kotlin code according to the code being inspected. This is meta-programming: writing code to generate code according to code. With a Kotlin Symbol Processor, we can generate implementation of interfaces at compile time, and delegate the implementation of said implementations to a mocker delegate. Introducing MocKMP The MocKMP project consists of multiple moving parts that allow to easily generate and configure mocks: A runtime that provides the mocker API A Kotlin Symbol Processor that generates configurable mocks A test helper library to make the use of mocks as easy as possible A Gradle plugin to ma

## Kotlin Native -- Using swift, not Objective-C

DevFeed: [Kotlin Native -- Using swift, not Objective-C](<https://devfeed.tech/articles/kotlin-native-using-swift-not-objective-c-24746.md>)

Original publisher: [Read original article](<https://medium.com/yazio-engineering/kotlin-native-using-swift-not-objective-c-d7742c040539?source=rss----65bd178b00af---4>)

Author: Paul Woitaschek

Published: 2021-11-19T08:00:42Z

Content type: tutorial

Language: en

Sources: [YAZIO Engineering - Medium](<https://devfeed.tech/sources/yazio-engineering-medium.md>)

Topics: [kotlin-native](<https://devfeed.tech/topics/kotlin-native.md>), [Code generation](<https://devfeed.tech/topics/code-generation.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [Objective-C](<https://devfeed.tech/topics/objective-c.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [interop](<https://devfeed.tech/tags/interop.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-native](<https://devfeed.tech/tags/kotlin-native.md>), [ksp](<https://devfeed.tech/tags/ksp.md>), [library](<https://devfeed.tech/tags/library.md>), [objective-c](<https://devfeed.tech/tags/objective-c.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

This tutorial explains how YAZIO uses Kotlin Native for shared business logic while providing a Swift-native iOS API. It describes the limitations of Kotlin-to-Objective-C interoperability and shows how KSP and SwiftPoet can generate Swift mappings for Kotlin types such as enums and sealed classes.

### Source excerpt

Kotlin Native -- Using Swift, not Objective-C At YAZIO we use Kotlin Native Extensively. The business logic of all new app features is exclusively written in Kotlin. In its core, every screen has one ViewModel which exposes a single Flow<ViewState> that the Android App and the iOS can consume to render the state. On Android, rendering the view state is no burden because it's the language we use in the Android App anyways. However this is different for iOS. While Swift does interop with Objective-C, the public API as seen from Swift is bad. A simple data class is exported as a regular class. The properties are not native Swift types. What should be a Bool becomes a KotlinBoolean. What should be come a Double becomes a KotlinDouble. But what we want is most of the times a struct with Swift types. These are the lesser evils, the greater ones are enums and sealed classes. In Objective-C, they both become regular classes. And therefore lose all the advantages they have when used from Swift. But what we want is a Swift enum. To overcome these restrictions for quite some time our iOS team has created mappings. There is a whole target, dedicated to mapping the Objective-C classes to Swift. Basically when developing a new feature, the whole public API is manually mapped to Swift. This is good because the result is a clean Swift-native API. But that's bad because it's extreme boilerplate and a real productivity killer. What if we could directly generate these mappings and use code generation to handle that for us? Turns out: There are two tools available that make it possible. The first one is KSP. It is basically a library that lets you implement a Kotlin compiler plugin and it gives you hooks to analyze the Kotlin Syntax Tree and generate code based on it. The second one is SwiftPoet. SwiftPoet is a library you can use to generate Swift code from Kotlin, similar to what KotlinPoet and JavaPoet do. Okay, let's get our handy dirty. For the basic setup, just follow the tutorial

## Kotlin Native -- Using swift, not Objective-C

DevFeed: [Kotlin Native -- Using swift, not Objective-C](<https://devfeed.tech/articles/kotlin-native-using-swift-not-objective-c-26007.md>)

Original publisher: [Read original article](<https://medium.com/yazio-engineering/kotlin-native-using-swift-not-objective-c-d7742c040539?source=rss-fbf9b6d94e65------2>)

Author: Paul Woitaschek

Published: 2021-11-19T07:21:13Z

Content type: tutorial

Language: en

Sources: [Stories by Paul Woitaschek on Medium](<https://devfeed.tech/sources/stories-by-paul-woitaschek-on-medium.md>)

Topics: [kotlin-native](<https://devfeed.tech/topics/kotlin-native.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Swift](<https://devfeed.tech/topics/swift.md>), [Code generation](<https://devfeed.tech/topics/code-generation.md>), [Objective-C](<https://devfeed.tech/topics/objective-c.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [Library](<https://devfeed.tech/topics/library.md>), [Tutorial](<https://devfeed.tech/topics/tutorial.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [kotlin-native](<https://devfeed.tech/tags/kotlin-native.md>), [ksp](<https://devfeed.tech/tags/ksp.md>), [library](<https://devfeed.tech/tags/library.md>), [objective-c](<https://devfeed.tech/tags/objective-c.md>), [swift](<https://devfeed.tech/tags/swift.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>)

### AI overview

This developer article explains how YAZIO uses Kotlin Native for shared business logic while addressing the limitations of exposing Kotlin types through Objective-C to Swift. It describes manually mapping the generated API to Swift and introduces KSP and SwiftPoet as tools for generating Swift mappings and reducing boilerplate.

### Source excerpt

Kotlin Native -- Using Swift, not Objective-C At YAZIO we use Kotlin Native Extensively. The business logic of all new app features is exclusively written in Kotlin. In its core, every screen has one ViewModel which exposes a single Flow<ViewState> that the Android App and the iOS can consume to render the state. On Android, rendering the view state is no burden because it's the language we use in the Android App anyways. However this is different for iOS. While Swift does interop with Objective-C, the public API as seen from Swift is bad. A simple data class is exported as a regular class. The properties are not native Swift types. What should be a Bool becomes a KotlinBoolean. What should be come a Double becomes a KotlinDouble. But what we want is most of the times a struct with Swift types. These are the lesser evils, the greater ones are enums and sealed classes. In Objective-C, they both become regular classes. And therefore lose all the advantages they have when used from Swift. But what we want is a Swift enum. To overcome these restrictions for quite some time our iOS team has created mappings. There is a whole target, dedicated to mapping the Objective-C classes to Swift. Basically when developing a new feature, the whole public API is manually mapped to Swift. This is good because the result is a clean Swift-native API. But that's bad because it's extreme boilerplate and a real productivity killer. What if we could directly generate these mappings and use code generation to handle that for us? Turns out: There are two tools available that make it possible. The first one is KSP. It is basically a library that lets you implement a Kotlin compiler plugin and it gives you hooks to analyze the Kotlin Syntax Tree and generate code based on it. The second one is SwiftPoet. SwiftPoet is a library you can use to generate Swift code from Kotlin, similar to what KotlinPoet and JavaPoet do. Okay, let's get our handy dirty. For the basic setup, just follow the tutorial